Install the memcached module in php in centos

Source: Internet
Author: User

Install the memcached module in php in centos

Install Required Software

Memcached php module

Wgethttp: // launchpad.net/libmemcached/1.0/0.42/javasdownload/libmemcached-0.42.tar.gz

Wgethttp: // pecl.php.net/get/memcached-1.0.2.tgz

Memcached official website http://www.memcached.org/

Install libmemcached

Tar zxvf libmemcached-0.42.tar.gz
Cd libmemcached-0.42
./Configure -- prefix =/usr/local/libmemcached -- with-memcached
Make & make install

Notes for installation: php memcached module 

1. Do not forget to install it.-with-memcached. Otherwise, you will be prompted.

Checking for memcached... No
Configure: error: "cocould not find memcached binary"

2,Is your memcached above 1.2.4? If not, you will be prompted

Clients/ms_thread.o: In function 'Ms _ setup_thread ':
/Home/zhangy/libmemcached-0.42/clients/ms_thread.c: 225: undefined reference to '_ sync_fetch_and_add_4 ′
Clients/ms_thread.o:/home/zhangy/libmemcached-0.42/clients/ms_thread.c: 196: more undefined references to '_ sync_fetch_and_add_4' follow
Collect2: ld returned 1 exit status
Make [2]: *** [clients/memslap] Error 1
Make [2]: Leaving directory '/home/zhangy/libmemcached-0.42 ′

Solution is-disable-64bit LAGS = "-O3-march = i686 ″,



The best way is to change the software version.

Https://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz

./Configure -- prefix =/usr/local/libmemcached -- with-memcached


If I don't need this 64-bit long data, I want php to expand memcached, so memcache is no different. It doesn't make much sense to install memcached.


Php extension memcached Installation

Tar zxvf memcached-1.0.2.tar.gz
Cd memcached-1.0.2
/Usr/local/php/bin/phpize

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

Make & make install

Vi/usr/local/php/lib/php. ini

Add extension = memcached. so and restart the service.

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.