: This article describes how to configure Memcached and PHP extensions in Ubuntu. For more information about PHP tutorials, see. Memcahe is a C/S architecture software, which consists of a client and a server;
What is memcache and what can it do? just go to Baidu;
Installation:
Sudo apt-get update
Sudo apt-get install memcached (memcached version is 1.4.14)
When installing memcached, the system will automatically install the memcache Client;
After the installation is successful, memcached will be automatically started. however, to prevent this, we recommend that you manually start memcached in either of the following ways:
① Sudo/etc/init. d/memcached start
② Sudo service memcached start
By the way, the last command:
Start command;
Restart;
Stop stops running;
Status to view the running status. (you can check the running status before you run other commands );
Next, install the PHP extension:
Sudo apt-get install php5-memcache
Open the php. ini file and add
[Memcache]
Extension = memcache. so
My LAMP is an integrated environment, xampp. when the environment is restarted, an error is reported because the memcache. so file cannot be found,
The above installation is, this file will be automatically generated in the/usr/lib/php5/20121212 directory, as long as you copy a copy to the xampp running Directory,
The specifics are as follows: cp/usr/lib/php5/20121212/memcache. so/opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/
By now, PHP can directly call memcache.
$ Doubi = new memcache ();
......
For PHP code examples, I have already introduced the introduction and use of Memcache in windows. I will not describe it in detail here;
The above describes how to configure Memcached and PHP extensions in Ubuntu, including some content. I hope to help some friends who are interested in PHP tutorials.