VPS Linux System installation memcached steps

Source: Internet
Author: User
Tags memcached php memcached vps vps linux

First go to the official under the latest version of Memcached (memcached-1.4.22.tar.gz) and dependent package libevent (libevent-2.0.21-stable.tar.gz):

http://www.memcached.org/files/

http://libevent.org/

There are two more PHP expansion packs:

Http://pecl.php.net/package/memcache

Http://pecl.php.net/package/memcached

The latest version of my current edition is: Memcache-2.2.7.tgz and memcached-2.2.0.tgz

Because PHP memcached package to install first libmemcached download the following

Https://launchpad.net/libmemcached

Latest Package libmemcached-1.0.18.tar.gz

The above five packages are downloaded well uploaded to the VPS:

First compile Libevent:

TAR-ZXVF libevent-2.0.21-stable.tar.gz
CD libevent-2.0.21-stable.tar.gz
./configure--prefix=/usr/local
Make && make install
TAR-ZXVF memcached-1.4.22.tar.gz
CD memcached-1.4.22
./configure--with-libevent=/usr/local
Make && make install
#因为自定义了安装路径所以软链下lib
Ln-s/usr/local/lib/libevent*/usr/lib/
#制作启动服务
CD scripts
MV Memcached.sysv/etc/init.d/memcached
#记得vi下你的memcached目录
chmod 755/etc/init.d/memcached
Chkconfig--add memcached
Chkconfig--level 345 memcached on
Chkconfig--list memcached

To modify the service startup content, note the actual path, configuration parameters, and PID file path as shown in the following illustration:

Next, compile PHP's two extensions:

TAR-ZXVF memcache-2.2.7.tgz
CD memcache-2.2.7
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-zlib-dir--enable-memcache
Make && make install
TAR-ZXVF libmemcached-1.0.18.tar.gz
CD libmemcached-1.0.18
./configure
Make && make install
TAR-ZXVF memcached-2.2.0.tgz
CD memcached-2.2.0
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
Make && make install

If it is done without errors, we can see the extended directory displayed by the terminal (note that it may not be the same as your directory)

Finally we edit php.ini to modify the Extension_dir directory and join Extension=memcache.so and extension=memcached.so
Reboot:

#memcached
Service memcached Start
#php
Service PHP-FPM Restart
PostScript: Verify that under memcached has not started successfully we can telnet 127.0.0.1 11211 re-enter stats look at the state

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.