Installation Environment: CentOS 6.4
PHP extension memcache to support the memcached Database cache server, the following is the installation method.
1. Download
: Http://pecl.php.net/package/memcache
File name: memcache-3.0.8.tgz
Upload files to/usr/local directory after successful download
2. Installation
[[email protected] local]# tar-zxvf memcache-3.0.8.tgz
[email protected] local]# STRONG>CD memcache-3.0.8
[[email protected] memcache-3.0.8]# /usr/local/php/bin/phpize
Configuring for:
PHP API version:20131106
Zend Module API no:20131226
Zend Extension API no:22013 1226
[[email protected] memcache-3.0.8]# ./configure--enable-memcache--with-php-config=/usr/ Local/php/bin/php-config--with-zlib-dir
[[email protected] memcache-3.0.8]# make
[[email protected] memcache-3.0.8]# make install
Installing shared extensions :/usr/local/php/lib/php/extensions/no-debug-zts-20131226/
[[email protected] memcache-3.0.8]# ll /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
Total 2140
-rwxr-xr-x. 1 root root 453766 Dec 17:44 memcache.so
-rwxr-xr-x. 1 root root 861055 Dec 16:47 redis.so
The presence of memcache.so indicates that the installation was successful.
3. Configuration support PHP
[Email protected] memcache-3.0.8]# VI +/usr/local/php/lib/php.ini
Add to
Extension=memcache.so
: wq! #保存退出
4. Restart Service
[Email protected] memcache-3.0.8]# /usr/local/apache2/bin/apachectl Restart
Nginx Server:
php5.3 to restart the php-fpm, simple restart Nginx can not make php.ini settings take effect
[[Email protected] memcached-2.2.0]# service nginx restart or/etc/init.d/nginx restart
[[Email protected] memcached-2.2.0]# service php-fpm restart or/etc/init.d/php-fpm restart
View Phpinfo to see the supported
PHP installation memcache extension under Linux