Compile and install memcached extensions

Source: Internet
Author: User

When compiling the memcached extension, you have to specify the location of the Libmemcached library

--with-libmemcached-dir=dir to specify the path. This path is the value of the prefix specified when installing libmemcached

So we have to install the Libmemcached library first.



First, install the libmemcached library

Why does the libmemcached library compile unsuccessfully, as if it requires a later version of the GCC compiler?
As I said online, I did the following:

Yum Install gcc44 gcc44-c++ libstdc++44-devel


The reason seems to be that the GCC version is too low
Countermeasure: Upgrade compiler version above libmemcached-1.0.2 version
# yum Install gcc44 gcc44-c++ libstdc++44-devel

# Export CC=/USR/BIN/GCC44
# Export CXX=/USR/BIN/G++44
#./configure


Question: What does cc and cxx say?

CC represents the GCC compiler. CXX represents the g++ compiler (for C + + source code)


After the installation is successful, assume that the library is installed in the following location:/usr/local/libmemcached-1.0.18/

Second, compile memcached extension

After installing the library, compile the memcached extension now.

Access to the memcached source directory

CD memcached-2.0.0
/usr/local/php/php-5.5.18/bin/phpize #去源码目录下执行phpize to generate a configure file in the current directory
./configure--with-php-config=/usr/local/php/php-5.5.18/bin/php-config--with-libmemcached-dir=/usr/local/ libmemcached-1.0.18/

Make

Make install this step will automatically copy the generated. So extension file to the PHP extension directory

Third, modify the php.ini

This is a simple step in adding the memcached.so extension. Needless to say.

Extra: Compiling memcache extensions (without D) is also the same operation. This extension relies on the Libmemcache library (also without D). Currently, memcached extensions are generally used, and the function is more complete.

Compile and install memcached extensions

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.