memcached Installation and PHP connection memcached

Source: Internet
Author: User

One: memcached installation

1) Install the extension source:

Yum install-y Epel -release

2) Install the relevant components:

Yum install-y libevent memcached libmemcached

3) Start the mamcached service:

/etc/ init.d/memcached Start

To see if the startup was successful:

PS aux |grep memcached650) this.width=650; "Src=" http://s1.51cto.com/wyfs02/M00/7E/5D/ Wkiom1b9fkcbv4w7aaaec3pdnlq703.png "title=" ckgr[t01) {}1q3{(_) $AZZW. png "alt=" Wkiom1b9fkcbv4w7aaaec3pdnlq703.png " />

Two: PHP connection memcached

1) first install php memcache extension

wget http://www.apelearn.com/bbs/data/attachment/forum/memcache-2.2.3.tgz

# tar ZXF memcache-2.2.3.tgz
# cdmemcache-2.2.3
#/usr/bin/phpize//yum installed PHP default will be under/usr/bin/phpize

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7E/59/wKioL1b9GaaBBTRtAAAatnaHrjo531.png "title=" ~ Xhrp8d%_b23j1es994kub2.png "alt=" Wkiol1b9gaabbtrtaaaatnahrjo531.png "/>

#./configure--with-php-config=/usr/bin/php-config //Here The path is determined by the specific circumstances
# Make && make install

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7E/59/wKioL1b9GyTx_FP6AAAQipZYdOk913.png "title=" S.png " alt= "Wkiol1b9gytx_fp6aaaqipzydok913.png"/>

Show installing shared extensions indicates that the installation is successful, there will be a memcache.so file under the following path , you can see it yourself LS

2) Remember the path to the back and then modify php.ini , put extension_dir= "./" revision changed to
Extension_dir= "/usr/lib/php/modules/"

and add a line:

extension= " memcache.so "

3) PHP Connection Memcached Inspection

/usr/bin/php-m |grep Memcache

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/5D/wKiom1b9IDXCN4NTAAAJDx9khlA215.png "title=" Nvun@8ddqjcb4ez9 (3 ' sijc.png "alt=" Wkiom1b9idxcn4ntaaajdx9khla215.png "/>//Search to Memcache module successfully loaded successfully

4) Download the test PHP script

Curl Www.apelearn.com/study_v2/.memcache.txt > 1.php 2>/dev/null

/usr/bin/php 1.php

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/5E/wKiom1b9IS3iknbfAAAziqJ0_M4869.png "title=" 6kowo{ ' 1fktm[a0{nfp$~2d.png ' alt= "wkiom1b9is3iknbfaaaziqj0_m4869.png"/>//php script successfully parsed

memcached Installation and PHP connection memcached

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.