Configure Memcached and PHP extensions in Ubuntu

Source: Internet
Author: User
Tags php code examples
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.