Memcache extension provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications. This article will explain how to install the memcache PHP extension on Centos/RedHat/Fedora.
The first, download the latest & stable package from http://pecl.php.net/package/memcache. Type the following command
# wget http://pecl.php.net/get/memcache-2.2.6.tgz
Extract memcache-2.2.6.tgz
# tar zxvf memcache-2.2.6.tgz
To install memcache extension, you need to install the php-devel package that matches the version of php that you are currently running. Example, i’m using PHP 5.3 then enter
# yum install php53-devel
Run the phpize command to prepare the build environment for a PHP extension
# phpize
Sample output
Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626
Configure & Install memcache extension. Type the following command
# ./configure # make # make install
If your get the following error message when run ./configure
checking for the location of ZLIB... no checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=to specify prefix where ZLIB include and library are located
Then type the following command to fix it
# yum install zlib zlib-devel
Finally, use the following command to add memcache extension to php.ini
# echo "extension=memcache.so" >> /etc/php.ini
Related Posts:
- How To Enable/Disable Firewall On Centos / RedHat / Fedora
- Linux Start / Stop / Restart Apache Server
- How To Setup A LAMP Server On Centos 6.0
- Zipping And Unzipping Files Under Linux
- RedHat / CentOS 32 Bit Support 4GB Or More RAM ( Memory )
- How To Install OpenSSH on Centos / RedHat
- Install RPM File On CentOS / RedHat
- Using yum command on CentOS / RedHat
- How to install IPTables on RedHat / Centos Linux
- How To Install PHP on Centos