查看apached错误日志发现有一条关于memcahed的警告:“PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-zts-20090626/memcache.so' - /usr/local/php/lib/php/extensions/no-debug-zts-

20090626/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0”

测试后发现memcache出问题了。

使用ls /usr/local/php/lib/ | grep php,发现php目录不存在,那么memcache的模块是不是存放在别的目录,用find / -name memcache.so和find / -name memcached分别查看memcache模块与memcached是否安装,发现模块不存在但memcached安装了,基本可以判断memcahe.so出现过误操作,进入源码包目录安装memcache-2.2.6.tgz的模块包,

tar zxvf memcache-2.2.6.tgz

cd memcache-2.2.6

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir --enable-memcache

make && make install

service httpd restart重新启动apahce

查看错误日志发现另一条警告:PHP Warning:  PHP Startup: memcache: Unable to initialize module\nModule compiled with module API=20060613\nPHP    compiled with module API=20090626\nThese options need to match\n in Unknown on line 0

出现该问题是由于PHP无法初始化memcached模块,删除所有的memcahed

tar zxf memcache-2.2.6.tar.gz

cd memcache-2.2.6

./configure --prefix=/usr/local/memcache

make && make install

tar zxvf memcache-2.2.6.tgz

cd memcache-2.2.6

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir --enable-memcache

make && make install

service httpd restart重新启动apahce

OK,apached错误日志再没有memcache的报警了。