Install method One, use wget to install directly
System: CentOS 5.5
Required Packages: libmemcached-1.0.15.tar.gz
Memcached-2.1.0.tgz
1. Pre-Installation Preparation
The code is as follows |
Copy Code |
wget https://launchpad.net/libmemcached/1.0/1.0.15/+download/libmemcached-1.0.15.tar.gz wget http://pecl.php.net/get/memcached-2.1.0.tgz |
2. Install libmemcached
The code is as follows |
Copy Code |
Tar zxf libmemcached-1.0.15.tar.gz && CD libmemcached-1.0.15 ./configure--prefix=/usr/local/libmemcached--with-memcached Make && make install |
3. Install php-memcached
The code is as follows |
Copy Code |
Tar zxf memcached-2.1.0.tgz && CD memcached-2.1.0 /usr/local/php/bin/phpize ./configure--enable-memcached--with-php-config=/usr/local/php/bin/php-config--with-libmemcacheddir=/usr/local/ Libmemcached Make && make install Vi/etc/php.d/memcached.ini extension= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/memcached.so" |
4. Verify
The code is as follows |
Copy Code |
Php-m|grep memcached Memcached |
Finally reboot Apache.
Method two, using Yum install installation
I. Installation of libevent development kits
The code is as follows |
Copy Code |
Yum Install Libevent-devel |
Second, install memcached
We get memcached installation package memcached-1.4.15.tar.gz from http://memcached.org/.
1. Configuration (Specify installation directory via parameter prefix)
The code is as follows |
Copy Code |
./configure--prefix=/usr/local/memcached--ENABLE-SASL
|
2. Compiling and installing
The code is as follows |
Copy Code |
Make Make install |
Iii. installation of libmemcached
Download the installation package libmemcached-1.0.15.tar.gz from the http://libmemcached.org/.
Configuration, compilation, and installation (–with-memcached specifies memcached execution program)
The code is as follows |
Copy Code |
./configure--with-memcached=/usr/local/memcached/bin/memcached Make Make install |
Iv. Installing PHP memcached Extensions
The code is as follows |
Copy Code |
/usr/local/php/bin/pecl Install memcached |
Add
Start
The code is as follows |
Copy Code |
memcached-d-u root-m 64-c 1024 |
The
-d option is to start a daemon
--The amount of memory that is allocated to memcache by the MB
-u run memcache user
-L Listener Server IP address
-p set memcache listening port. Preferably more than 1024 of the port
-C Maximum number of concurrent connections, the default is 1024, according to your server load to set
-p settings save memcache pid file