Today, the installation of their own environment of the latest PHP5.4.8, the results in the memcache with the incompatibility problem, the repeated scheduling summarizes the reasons for incompatibility and solutions.
Emcache (sudo pecl install memcache) PHP extension, compiled memcache.so in/usr/lib/php5/20090626/, In php.ini add good extension, restart PHPFPM (not restart Nginx), the following error message appears:
The code is as follows |
Copy Code |
Gracefully shutting down php-fpm. Done Starting PHP-FPM [25-oct-2012 12:04:02] NOTICE: PHP message:php warning:php Startup:memcache:Unable to initialize module Module compiled with module api=20090626 PHP compiled with module api=20100525 These options need to match |
PHP is compiled with PHP core version is 20100525, and pecl inside of the memcache is compiled with 20090626 version, version inconsistency caused PHP to not enable the Memcache.so library. The solution is to uninstall the Pecl way to install the memcache, Pecl.php.net/package/memcache download the source package to compile their own.
The code is as follows |
Copy Code |
# #卸载memcache sudo pecl uninstall memcache
Phpize ./configure--enable-memcache--with-php-conf=/usr/local/php/bin/php-config Make Make install |
Start memcached service: memcached-d-M 256-p 11211. Test script: OK.
The code is as follows |
Copy Code |
$mem = new Memcache; $mem->connect (' 127.0.0.1 ', 11211); $mem->set (' Feiyan ', ' blog '); Var_dump ($mem->get (' Feiyan ')); |
http://www.bkjia.com/PHPjc/629830.html www.bkjia.com true http://www.bkjia.com/PHPjc/629830.html techarticle today, the installation of their own environment of the latest PHP5.4.8, the results in the memcache with the incompatibility problem, the repeated scheduling summarizes the reasons for incompatibility and solutions. Emcache (sudo ...