Author Topic: install memcached on directadmin debian 8  (Read 4543 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
install memcached on directadmin debian 8
« on: มีนาคม 01, 2018, 08:36:29 AM »
ทำการลง memcache ให้กับระบบ DirectAdmin บน Debian 8.x สำหรับ php5.x ใช้เป็น memcache 2.x ได้
แต่ถ้าเป็น php7.x ให้ใช้เป็น memcache3.x ขึ้นไป
#apt-get install memcached
#apt-get install autoconf
#pecl install memcache




configuration option "php_ini" is not set to php.ini location
You should add "extension=memcache.so" to php.ini

#vi /usr/local/lib/php.ini
extension=memcache.so

Restart Memcached process.
#systemctl restart memcached

To auto-start Memcached on booting.
#systemctl enable memcached

Confirm the Memcached running status.
#echo "stats settings" | nc localhost 11211
« Last Edit: กันยายน 08, 2019, 10:09:30 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: install memcached on directadmin debian 8
« Reply #1 on: กันยายน 08, 2019, 02:26:12 PM »
หรือ
#/usr/local/php72/bin/pecl install memcache
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading memcache-2.2.7.tgz ...
Starting to download memcache-2.2.7.tgz (36,459 bytes)
..........done: 36,459 bytes
11 source files, building
running: phpize72
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
Enable memcache session handler support? [yes] :

ถ้าตอนรัน
#/usr/local/php72/bin/pecl install memcache
เกิดเจอ error ดังนี้
Makefile:193: recipe for target 'memcache.lo' failed

ทำการแก้ไขโดยติดตั้ง ตัว build-essential กับ libtool ให้เรียบร้อยครับ
apt-get install build-essential libtool autoconf unzip wget

แล้วทำการรันอีกรอบ
#/usr/local/php72/bin/pecl install memcache
« Last Edit: กันยายน 08, 2019, 10:09:41 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: install memcached on directadmin debian 8
« Reply #2 on: กันยายน 08, 2019, 10:11:51 PM »
### memcached3.13 on PHP7.2 in centos style

wget http://pecl.php.net/get/memcached-3.1.3.tgz
# tar -zxf memcached-3.1.3.tgz
# cd memcached-3.1.3
# /usr/local/apps/php72/bin/phpize
# LDFLAGS="-L/usr/local/apps/lib" CPPFLAGS="-I/usr/local/apps/include" ./configure --with-php-config="/usr/local/apps/php72/bin/php-config" --with-zlib-dir="/usr/local/apps" --disable-memcached-sasl && make && make install
# cd
# cp /root/memcached-3.1.3/modules/memcached.so /usr/local/apps/php72/ext

2. Open the PHP 72 extra.ini file by executing the following command as root:
# vi /usr/local/apps/php72/etc/php.d/extra.ini

3. Add the following statement to the end of the file:
extension=memcached.so

4. Restart the PHP72 service from commandline as root:
# service php-fpm72 restart

Once done, you will find the memcached extension loaded in PHP 72 using following command:
# php -m | grep memcached
« Last Edit: กันยายน 08, 2019, 10:15:52 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: install memcached on directadmin debian 8
« Reply #3 on: กันยายน 08, 2019, 10:17:07 PM »
ถ้าจะติดต่อ memcached3.1.3 กับ PHP7.2 บน Debian8
ต้องทำการติดตั้ง libmemcached ให้เรียบร้อยก่อนทุกครั้ง

#wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
# tar -zxvf libmemcached-1.0.18.tar.gz
# cd libmemcached-1.0.18
# ./configure
# make && make install
---
Configuration summary for libmemcached version 1.0.18

   * Installation prefix:       /usr/local
   * System type:               unknown-linux-gnu
   * Host CPU:                  x86_64
   * C Compiler:                cc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
   * C Flags:                   -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress -Wvarargs -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmaybe-uninitialized -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked
   * C++ Compiler:              c++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
   * C++ Flags:                 -g -O2 -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Wvarargs -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmaybe-uninitialized -Wmissing-field-initializers -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wtrampolines -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wc++11-compat -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wunused-local-typedefs -Wwrite-strings -Wformat-security -fwrapv -pipe -fPIE -pie -Wsizeof-pointer-memaccess -Wpacked
   * CPP Flags:                  -fvisibility=hidden
   * LIB Flags:                 
   * Assertions enabled:        no
   * Debug enabled:             no
   * Shared:                    yes
   * Warnings as failure:       no
   * SASL support:              yes
   * make -j:                   13
   * VCS checkout:              no

เริ่มทำการลง memcached 3.1.3 ใน debian8
#/usr/local/php72/bin/pecl install memcached