drupal后台报告:PECL Memcache earlier than 3.0.6 is not supported
now,需要升级pecl
memcache,查相关资料说3.0.6依然会导致drupal运行过程中出现奇怪的不稳定现象,建议升级到3.0.8。
升级过程参考如下:
Everytime I go to the
Drupal status page of my local dev, I see this message:
There is a problem with
your memcache configuration. Please review README.txt for help
resolving the following issue: PECL Memcache version 2.2.7 is
unsupported. Please update to 3.0.6 or newer.
Let’s check info on
installed version:
pecl info memcache
About pecl.php.net/memcache-2.2.7=================================
Release Type PECL-style
PHP extension (source code)Name memcache Channel
pecl.php.net Summary memcached extension Description Memcached is a
caching daemon designed especially for dynamic web
applications to decrease database load by storing objects in
memory. This extension allows you to work with memcached through
handy OO and procedural interfaces. Maintainers Antony Dovgal
(lead, inactive) Mikael Johansson (lead)
Herman Radtke (lead)Release Date 2012-09-23 01:51:08
Release Version 2.2.7 (stable)API Version 2.2.7
(stable)License PHP License
(http://www.php.net/license)Release Notes - PHP 5.4
compatibility - Fixed return value error
get_host_port_from_server(). - Fixed PECL Bug #16672
(memcache.php doesn't support unix socket) - Fixed pecl bug
#19374 (memcache.php throws Notice: Undefined index:
VALUE when viewing expired items)Required Dependencies PHP version
4.3.11 PEAR installer version 1.4.0b1 or newer package.xml version
2.0 Last Modified 2014-04-01 15:57 Previous Installed - None -
Version
Let’s check the latest
available version:
pecl remote-info memcache
Package details:================
Latest 3.0.8 Installed
2.2.7 Package memcache License PHP License Category Caching Summary
memcached extension Description Memcached is a caching daemon
designed especially for dynamic web applications to decrease
database load by storing objects in memory. This
extension allows you to work with memcached through handy OO and
procedural interfaces.
Now, let’s try to
upgrade this.
sudo pecl upgrade memcache
Nothing to upgrade
I guess we can’t
upgrade. Let’s uninstall the old version and install the latest
version.
sudo pecl uninstall memcache
Unable to remove "extension=memcache.so"
from php.ini uninstall
ok: channel://pecl.php.net/memcache-2.2.7
Install specific
version:
sudo pecl install memcache-3.0.8
downloading memcache-3.0.8.tgz ...
Starting to download memcache-3.0.8.tgz (
70,523
bytes).................done: 70,523 bytes 15 source
files, building running: phpize Configuring for: PHP Api Version:
20090626 Zend Module Api No: 20090626 Zend Extension Api No:
220090626 Build complete. Don't forget to run 'make test'.
running: make
INSTALL_ROOT="/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8"
install Installing shared extensions:
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr/lib/php5/20090626+lfs/
running: find
"/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8" |
xargs ls -dils 421768 4 drwxr-xr-x 3 root root 4096 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8 421804
4 drwxr-xr-x 3 root root 4096 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr
421805 4 drwxr-xr-x 3 root root 4096 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr/lib
421806 4 drwxr-xr-x 3 root root 4096 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr/lib/php5
421807 4 drwxr-xr-x 2 root root 4096 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr/lib/php5/20090626+lfs
421803 364 -rwxr-xr-x 1 root root 372210 Aug 16 13:31
/tmp/pear/temp/pear-build-rootdfXhAS/install-memcache-3.0.8/usr/lib/php5/20090626+lfs/memcache.so
Build process completed successfully Installing
'/usr/lib/php5/20090626+lfs/memcache.so' install ok:
channel://pecl.php.net/memcache-3.0.8 configuration option
"php_ini" is not set to php.ini location You should add
"extension=memcache.so" to php.ini
途中遇到报错ERROR: `/var/tmp/memcache/configure --enable-memcache-session=yes' failed,安装zlib-devel
后解决,如下所示:
[root@localhost ~]# pecl install memcache
checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=
ERROR: `/var/tmp/memcache/configure --enable-memcache-session=yes' failed
[root@localhost ~]# yum install zlib-devel
[root@localhost ~]# pecl install memcache
Build process completed successfully
Installing '/usr/lib64/php/modules/memcache.so'
install ok: channel://pecl.php.net/memcache-2.2.7
configuration option "php_ini" is not set to php.ini location
You should add "extension=memcache.so" to php.ini
因为之前已经在php.ini中进行过相关设置,可略去修改php.ini的步骤:
[root@localhost ~]# vi /etc/php.ini
[root@localhost ~]# service
httpd restart