Install Memcached extension connection for PHP

Source: Internet
Author: User

Install Memcached extension connection for PHP

First, you must complete necessary software installation. memcached is the php extension for connecting php to the memcached server. Its name is memcached.

In the past, a memcache extension was used to connect php to the memcached server. Its name was memcache.

The memcache and memcached extensions of php are used as clients to connect to the memcached server.

However, memcached, as a client, has better performance and more powerful features than memcache, and memcache has stopped updating. Therefore, if you use extensions now, you can use

Memcached

Next install necessary components: wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

Mkdir/usr/local/libmemcached

Tar xf libmemcached-1.0.18.tar.gz cd libmemcached-1.0.18

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

Make & make install

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

Tar xf memcached-2.2.0.tgz cd memcached-2.2.0

/Usr/local/php/bin/phpize (generate configure file)

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

Enable-memcached

Make & make install

Echo "extension = memcached. so">/etc/phpini

Service php-fpm restart

Php supports using memcached.

Simply put, memcached Server

Install yum-y install memcached service memcached start

Put the default memcached parameters in the/etc/sysconfig/memcached file.

Memcached reads this file every time it is started.

You can use the telnet command to log on to memcached, for example, yum-y install telnet 127.0.0.1 11211

Run the stats command to view the status of memcached after logging in.

The above php script is connected to memcached and sets the int value to 99.

/Usr/local/php/bin/php/usr/local/nginx/html/test. php (execute the above php script)

View:

Memcached connection successful.

Install and configure Memcached source code in CentOS 6.6

Memcached installation and startup script

Performance problems of using Memcached in PHP

Install Memcached in Ubuntu and its command explanation

Install and apply Memcached

Use Nginx + Memcached's small image storage solution

Getting started with Memcached

For details about Memcached, click here
Memcached: click here

This article permanently updates the link address:

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.