The premise for setting up PHP + Memcached based on this article is that PHP5.3.4 and Apache2.2.3 have been installed. Next, install Memcached (server) and PHP extension memcache or memcached (in actual use, you can select one of them .) 1) install Memcached (server) read: Configure Apache + FastCGI (mod_fcgid) + PH on RHEL5.3 (Tikanga)
The premise for setting up PHP + Memcached based on this article is that PHP 5.3.4 and Apache 2.2.3 have been installed. Next, install Memcached (server) and memcache or memcached (in actual use, you can select one of them .)
1) install Memcached (server)
Related reading:
Configure Apache + FastCGI (mod_fcgid) + PHP http://www.linuxidc.com/Linux/2012-02/53418.htm on RHEL 5.3 (Tikanga)
Build Git http://www.linuxidc.com/Linux/2012-02/53420.htm at RHEL 5.3 (Tikanga)
Configure Apache + FastCGI (mod_fastcgi) + PHP http://www.linuxidc.com/Linux/2012-02/53419.htm on RHEL 5.3 (Tikanga)
A. Download and compile and install libevent.
[Plain]
- Wget http://www.monkey.org /~ Provos/libevent-2.0.7-rc.tar.gz
- Tar-xzvf libevent-2.0.7-rc.tar.gz
- Cd libevent-2.0.7
- ./Configure & make
- Make install
B. Download and compile and install Memcached (server)
[Plain]
- Wget http://memcached.googlecode.com/files/memcached-1.4.9.tar.gz
- Tar-xzvf memcached-1.4.9.tar.gz
- Cd memcached-1.4.9
- ./Configure-prefix =/usr/local
- Make
- Make test
- Make install
C. Run the following command to start Memcached in daemon mode:
[Plain]
- Memcached-d-u root
2) install memcache
A. Download and compile and install memcache
(Find the latest version: http://pecl.php.net/package/memcache here)
[Plain]
- Wget http://pecl.php.net/get/memcache-3.0.5.tgz
- Tar-xzvf memcache-3.0.5.tgz
- Cd memcache-3.0.5
- Phpize
- ./Configure -- enable-memcache -- with-php-config =/usr/bin/php-config
- Make & make test
- Make install
B. Enable PHP to load this module.
[Plain]
- Cd/etc/php. d
- Vim memcache. ini
- ; Enable memcache extension module
- Extension = memcache. so
C. Check whether the module is successfully loaded.
[Plain]
- Php-m | grep memcache
D. Access the memcache management interface.
[Plain]
- Cp ~ /Memcache-3.0.5/memcache. php/var/www/memcache. php
- Vim/var/www/memcache. php
- $ MEMCACHE_SERVERS [] = '192. 0.0.1: 100 ';
- Access following URL:
- Http://x.x.com/memcache.php
3) Use PECL (The PHP Extension Community Library) to install memcached
A. Download and compile and install libmemcached.
[Plain]
- Wget http://launchpad.net/libmemcached/1.0/1.0.2/+download/libmemcached-1.0.2.tar.gz
- Tar-xzvf libmemcached-1.0.2.tar.gz
- Cd libmemcached-1.0.2
- ./Configure
- Make
- Make install
B. Use PECL to install memcached.
[Plain]
- Pecl install memcached
C. Enable php to load this module
[Plain]
- Cd/etc/php. d
- Vim memcached. ini
- ; Enable memcached extension module
- Extension = memcached. so
D. Check whether the module is successfully loaded.
[Plain]
- Php-m | grep memcached