Install Memcached extension connection for PHP
First, you must complete necessary software installation. memcached is the php extension for connecting php to the memcached server. Its name is memcached.
In the past, a memcache extension was used to connect php to the memcached server. Its name was memcache.
The memcache and memcached extensions of php are used as clients to connect to the memcached server.
However, memcached, as a client, has better performance and more powerful features than memcache, and memcache has stopped updating. Therefore, if you use extensions now, you can use
Memcached
Next install necessary components: wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
Mkdir/usr/local/libmemcached
Tar xf libmemcached-1.0.18.tar.gz cd libmemcached-1.0.18
./Configure -- prefix =/usr/local/libmemcached -- with-memcached
Make & make install
Wget http://pecl.php.net/get/memcached-2.2.0.tgz
Tar xf memcached-2.2.0.tgz cd memcached-2.2.0
/Usr/local/php/bin/phpize (generate configure file)
./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-libmemcached-dir =/usr/local/libmemcached --
Enable-memcached
Make & make install
Echo "extension = memcached. so">/etc/phpini
Service php-fpm restart
Php supports using memcached.
Simply put, memcached Server
Install yum-y install memcached service memcached start
Put the default memcached parameters in the/etc/sysconfig/memcached file.
Memcached reads this file every time it is started.
You can use the telnet command to log on to memcached, for example, yum-y install telnet 127.0.0.1 11211
Run the stats command to view the status of memcached after logging in.
The above php script is connected to memcached and sets the int value to 99.
/Usr/local/php/bin/php/usr/local/nginx/html/test. php (execute the above php script)
View:
Memcached connection successful.
Install and configure Memcached source code in CentOS 6.6
Memcached installation and startup script
Performance problems of using Memcached in PHP
Install Memcached in Ubuntu and its command explanation
Install and apply Memcached
Use Nginx + Memcached's small image storage solution
Getting started with Memcached
For details about Memcached, click here
Memcached: click here
This article permanently updates the link address: