Regarding the high-performance distributed memory object caching system Memcached, we have mentioned in another article "How to install memcached in Windows system". This time, let's take a look at how to install Memcached and PHP Memcached extension in CentOS system I. Install Memcached 1. Install the dependency package libevent Memcached depends on the libevent library, so you may need to execute before installation yum install libevent-devel 2. Install memcached Download the latest source code from http://memcached.org/ (1.4.23) tar -xzvf memcached-1.4.23.tar.gz cd memcached-1.4.23 ./configure --prefix=/usr/local/memcache make && make install 3. Configure memcached to start automatically Copy scripts/memcached.sysv in the source directory to /etc/init.d/memcached. You need to modify the following line in /etc/init.d/memcached: chown $USER /usr/local/memcache/bin/memcached daemon /usr/local/memcache/bin/memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached/memcached.pid $OPTIONS (That is, to modify the path where memcached is located) Then execute the following command: chmod 755 memcached chkconfig --add memcached Use the following command to start the service service memcached start II. Install PHP Memcached extension There are two memcache extensions from pecl.php.net:
The version of memcached is relatively new and uses the libmemcached library. libmemcached is considered to be better optimized and should have higher performance than the PHP-only version of memcache. So memcached is installed here (assuming php5.4 is already installed in /usr/local/php). 1. Install dependent libraries https://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz tar -xzvf libmemcached-1.0.4.tar.gz cd libmemcached-1.0.4 ./configure make make install 2. Install memcached Download from http://pecl.php.net/get/memcached-2.0.1.tgz and install using the following command: tar vxzf memcached-2.0.1.tgz cd memcache-2.0.1 phpize ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config make make install After the installation is complete, find the generated memcached.so in the directory indicated by the last displayed Of course, we can also write a small test code to see if memcached is running properly. For specific steps, please refer to the article How to install memcached under Windows system Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Vue Virtual DOM Quick Start
>>: MySQL uses find_in_set() function to implement where in() order sorting
Table of contents 1. Instructions for use 2. Prep...
Download: http://dev.mysql.com/downloads/mysql/ U...
This article mainly introduces the example analys...
1. What is a proxy server? Proxy server, when the...
I will use three days to complete the static page...
Preface This tutorial installs the latest version...
I have always been interested in wireless interac...
Today I received a disk alarm exception. The 50G ...
This article shares the installation tutorial of ...
When using MySQL, we often sort and query a field...
1. Install the express library and generator Open...
According to null-values, the value of null in My...
Table of contents 1. Basic overview of the proces...
Many people may ask, does the text on the website...
Table of contents What is an agent Basic knowledg...