Memcached three ways to install PHP memcache extensions

Source: Internet
Author: User
See Http://code.google.com/p/memcached/wiki/PHPClientComparison for comparison. It is recommended to use the new memcached, the installation method is basically the same as below, just need to install libmemcached first, if you need to enable compression, you also need to install zlib.
Compiling a shared PECL extension library with PECL
$ pecl Install Extname
Then is a long list of automatic execution, and finally the program tells you that you should add "extension=memcache.so" to php.ini, of course, but also to put the newly generated memcache.so into your PHP extension library directory.
In the official website of the manual is to use the pear to install the extension, but to the actual operation will appear error, said can not find memcache, let me use pecl install ...
Compiling a shared PECL extension library with Phpize
The above method is to be downloaded. You can also do it yourself, and then install it with phpize.
First down, then unzip, then go into the directory, execute:
$ phpize
$./configure
$ make
# make Install
Then put the memcache.so in your PHP extensions directory and php.ini Riga extension=memcache.so.
The last extreme way to extend static compilation, why is it such a laborious method? The legend is that it will be more efficient than. So, I have not compared ...
You can go to the next package, then unzip, put in the PHPSRC directory to be installed under the EXT directory, and then:
$ RM Configure
$./buildconf--force
$./configure--help
$./configure--with-memcache
$ make
$ make Install
A bit messy, there are better articles:
Memcached:
http://willko.javaeye.com/blog/332993
http://cn2.php.net/manual/en/book.memcached.php
http://cn.php.net/manual/en/book.memcache.php
Pecl
http://cn2.php.net/manual/en/install.pecl.php
Memcache can study a lot of things, such as the partial hash strategy, as a session strategy, persistent memcache and so on. Have a chance to Hu Yu again.
--eof--

The above describes the memcached php memcache extension of the three installation methods, including the memcached aspect of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.