Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Memcached and PHP Memcached extensions under CentOS

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install Memcached and PHP Memcached extensions under CentOS related knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you will have a harvest after reading this article on how to install Memcached and PHP Memcached extensions under CentOS, let's take a look.

i. Install memcached

1. Install the dependency package libevent

Memcached depends on the libevent library, so you may need to execute the

Yum install libevent-devel

two。 Install memcached

Download the latest source version from (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 self-startup

To copy scripts/memcached.sysv to / etc/init.d/memcached under the source code directory, you need to modify / etc/init.d/memcached as shown below:

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, modify the path where memcached is located)

Then execute the following command:

Chmod 755 memcached chkconfig-add memcached

Start the service using the following directive

Service memcached start

ii. Install the php memcahced extension

Pecl.php.net has two memcache extensions:

Memcache memcached extension

Memcached php extension for interfacing with memcached via libmemcached library

The version of memcached is relatively new and uses the libmemcached library. Libmemcached is considered to have been 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

Tar-xzvf libmemcached-1.0.4.tar.gz cd libmemcached-1.0.4. / configure make make install

two。 Install memcached

Download and install using the following instructions:

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 that directory according to the directory path indicated by the last display of installing shared extensions: / usr/local/***, and copy it to the directory pointed to by php.ini 's extension_dir. Modify the php.ini to add the line extension = memcached.so to restart apache, and then open the phpinfo information page on the page to see if the memcached extension has been installed successfully.

This is the end of the article on "how to install Memcached and PHP Memcached extensions under CentOS". Thank you for reading! I believe you all have a certain understanding of "how to install Memcached and PHP Memcached extensions under CentOS". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report