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
This article example shares the specific code of ...
Without further ado, I will post the code for you...
Table of contents Preface text 1. Closure 1.1 Wha...
Table of contents 1. Use slots to make components...
Create a table create table order(id varchar(10),...
Table of contents Technology Stack Backend build ...
<br /> Note: All texts, except those indicat...
MySql Download 1. Open the official website and f...
In the /etc/my.conf file, add the following line ...
Version 1.4.2 Official Documentation dockerhub st...
Effect picture: Implementation code: <template...
Core code -- Below I will demonstrate the impleme...
Imagine a scenario where, when designing a user t...
Before reading this article, it is best to have a...
[LeetCode] 196.Delete Duplicate Emails Write a SQ...