installation based on the libmemcached,php extension memcached Zhang Ying Posted in .- -- -Category: Php Tags: libmemcached, memcached, PHP, installation One, why install memcached extension memcached 1.2. 4 and above increase the CAS (Check and Set) protocol, for concurrent processing of multiple trips on the same key. In fact, the root database is very similar, if there are several processes on the same table of the same data to update, it will not fight, haha. The database can lock the entire table, you can also lock the table inside the function of a row, in fact, Memcached joined the CAS root this almost. PHP extension memcache, does not support CAs, so we want to install memcached extension, memcached extension is based on libmemcached, so you want to mount libmemcached two, view memcahced version information Telnet 127.0.0.1 12000Stats You'll see the following information stat PID15322STAT Uptime1885STAT Time1279455772STAT version1.2.8STAT pointer_size +if the version is too low, consider reinstalling exit Telnet, CTRL+then press Q on the line. Third, install the software wget http://launchpad.net/libmemcached/1.0/0.42/+download/libmemcached-0.42.tar.gzwget http://pecl.php.net/get/memcached-1.0.2.tgzMemcached's official website http://www.memcached.org/Four, install Libmemcachedtar ZXVF libmemcached-0.42. TAR.GZCD libmemcached-0.42./configure--prefix=/usr/local/libmemcached--with-Memcachedmake&&issues to be aware of make install installation:1, do not forget the installation process,--with-memcached, or you will be prompted checking formemcached ... noconfigure:error:"could not find memcached binary"2, your memcached is not 1.2. 4 + If you are not prompted to 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'FollowCollect2:ld returned1Exit statusmake[2]: * * * [CLIENTS/MEMSLAP] Error1make[2]: Leaving directory '/home/zhangy/libmemcached-0.42'the solution is--disable-64bit cflags="-o3-march=i686", if you do not use this 64-bit long data, I think PHP extension Memcached,memcache is no different, the installation of memcached is no longer interesting. Five, PHP extension memcached installation of tar zxvf memcached-1.0.2. TAR.GZCD memcached-1.0.2/usr/local/php/bin/phpize./configure--enable-memcached--with-php-config=/usr/local/php/bin/php-config--with-libmemcached-dir=/usr/local/libmemcached./configure--prefix=/usr/local/phpmemcached--with-Memcachedmake&&Make Installvi/usr/local/php/lib/php.ini Plus extension=memcached.so to re-start the service.
Installation based on the libmemcached,php extended memcached