Install the memcached module in php in centos
Install Required Software
Memcached php module
Wgethttp: // launchpad.net/libmemcached/1.0/0.42/javasdownload/libmemcached-0.42.tar.gz
Wgethttp: // pecl.php.net/get/memcached-1.0.2.tgz
Memcached official website http://www.memcached.org/
Install libmemcached
Tar zxvf libmemcached-0.42.tar.gz
Cd libmemcached-0.42
./Configure -- prefix =/usr/local/libmemcached -- with-memcached
Make & make install
Notes for installation: php memcached module
1. Do not forget to install it.-with-memcached. Otherwise, you will be prompted.
Checking for memcached... No
Configure: error: "cocould not find memcached binary"
2,Is your memcached above 1.2.4? If not, you will be prompted
Clients/ms_thread.o: In function 'Ms _ setup_thread ':
/Home/zhangy/libmemcached-0.42/clients/ms_thread.c: 225: undefined reference to '_ sync_fetch_and_add_4 ′
Clients/ms_thread.o:/home/zhangy/libmemcached-0.42/clients/ms_thread.c: 196: more undefined references to '_ sync_fetch_and_add_4' follow
Collect2: ld returned 1 exit status
Make [2]: *** [clients/memslap] Error 1
Make [2]: Leaving directory '/home/zhangy/libmemcached-0.42 ′
Solution is-disable-64bit LAGS = "-O3-march = i686 ″,
The best way is to change the software version.
Https://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz
./Configure -- prefix =/usr/local/libmemcached -- with-memcached
If I don't need this 64-bit long data, I want php to expand memcached, so memcache is no different. It doesn't make much sense to install memcached.
Php extension memcached Installation
Tar zxvf memcached-1.0.2.tar.gz
Cd memcached-1.0.2
/Usr/local/php/bin/phpize
. /Configure -- with-memcached-with-php-config =/usr/local/php/bin/php-config -- with-libmemcached-dir =/usr/local/libmemcached -- enable -memcached
Make & make install
Vi/usr/local/php/lib/php. ini
Add extension = memcached. so and restart the service.