PHP installation memcache extension under Linux

Source: Internet
Author: User
Tags zts nginx server zend

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

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.