php5.4.x and Memcache Incompatible Solutions _php Tutorials

Source: Internet
Author: User
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.