Install the memcached extension module for php in CentOS

Source: Internet
Author: User
Recently, the company needs to deploy several new servers, mainly the lnmp platform. these servers need to deploy the company's system? Gull sticks and throws to your arms? Why is the quality cut rate too high ?? Long complaints? What are the advantages of the image market ?? What is the peak rate of a local bread? Mu? Low withdrawal? When the screen appears, the nest is thirsty, and the horse is playing ?? The master is in the middle of the school? Hellip; & hellip ;). & Nb

Recently, the company needs to deploy several new servers, mainly the lnmp platform. these servers need to deploy the company's system? Gull sticks and throws to your arms? Why is the quality cut rate too high ?? Long complaints? What are the advantages of the image market ?? What is the peak rate of a local bread? Mu? Low withdrawal? When the screen appears, the nest is thirsty, and the horse is playing ?? The master is in the middle of the school? Hellip ;...).

During the environment deployment process, for the first time, I really felt the impact of various software versions on the system. I deployed the environment on a virtual machine dozens of times, after many of them are deployed, the system is messed up, and then the system is Crashed. at, various pitfalls are found and various methods of filling holes are found.

At the beginning, I used full source code compilation to build the platform. as a result, it was very troublesome and error-prone to integrate various software, in desperation, I had to choose the yum method to install the platform (don't ask me why I didn't use yum at first, I just thought that the source code compilation would look like my technology is superb ). In fact, there is another reason to choose the source code for installation, that is, the installation directory is clear, and it will be easier to find a file or something later.

In this article, I will not talk much about the complete deployment process of the company environment. I will write a small problem encountered during the installation process.

When I spent a lot of effort, it was not easy to make the company environment good, I was so happy, I went to the code, rushed to open the browser, enter the address, press enter, wait ...... Then the system burst! Wipe it! It broke down !!! The page does not display the beautiful pictures of the company's system, but directly generates a bunch of error messages, prompting that the system does not support memcached. Memcached ??!! How is it possible? I have already installed memcached. then I used the php-m command to check the module loaded by php. I found that php has loaded the memcache module and asked the supervisor about it, he told me to load another memcached module, and then I went into another trap filling process, so I won't go into details about the process. In short, after a great deal of hard work, I finally succeeded.

I checked a lot of methods on the internet and found that the software I downloaded is not correct, php extensions need to go to a specialized website to find extension packages, this site is http://pecl.php.net/This is a php extension package site, you can find the php extension package for memcached on this website. after searching for memcached, I downloaded the memcached-2.2.0.tgz, next we will officially go into the process of installing the memcached extension (as if we have already said a lot of nonsense ...... No matter. no one looks at my blog anyway)

Download libmemcached first:

Wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

Unwrapped: tar-zxf libmemcached-1.0.18.tar.gz

Enter the decompressed package, compile and install it:

./Configure -- prefix =/usr/local/libmemcached -- with-memcached // Note: -- with-memcached must be added to this option.

Make & make install

After the installation is complete, install the memcached module:

Wget http://pecl.php.net/get/memcached-2.2.0.tgz

Unwrapped: tar-zxf memcached-2.2.0.tgz

Go to the directory after unpacking, and use the phpize command to generate a configure file.

Phpize // note that this command will be in the bin directory under the installation directory during php compilation and installation, however, in php installed in yum, you need to install a php-devel package (I am stuck here ......)

./Configure -- with-php-config =/usr/bin/php-config -- with-libmemcached-dir =/usr/local/libmemcached

// If you do not know where php-config is, use the find/-name php-config command.

Make & make install

After the installation is complete, add an extension = memcached. so record to the php. ini file, and then run the php-m command to view the memcached module.

Related Article

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.