Home  >  Article  >  Backend Development  >  yum how to install php memcached

yum how to install php memcached

藏色散人
藏色散人Original
2020-08-15 09:45:212199browse

Yum method to install php memcached: first make a soft connection to the php file; then install memcached by executing the command "# yum install memcached"; finally install the php extension module and check whether there is a memcached module.

yum how to install php memcached

Recommendation: "PHP Video Tutorial"

yum installs the php extension module—memcache

Specific steps:

1. For convenience, we first make a soft connection to the php file, as follows: ln -s /usr/local/php/bin/php /usr/bin . Check the module command in php: php -m, the result is as follows:

yum how to install php memcached

2. Enter the php installation directory, we can see that there is no memcache. Command: cd /usr/local/src/ php-5.3.27/ext, the result is as follows:

yum how to install php memcached

3. Install memcache, the command is as follows:

# yum install libevent libevent-deve  (安装libevent库)
   # yum install memcached  (安装memcached)
    # service memcached start  (启动)

4. Test # memcached –h, the results are as follows:

yum how to install php memcached

//If you can see the following style, the installation is normal

5. Installation PHP extension module

# yum -y install libmemcached  (安装libmemcached扩展)
  # yum-y install php-pecl-memcache.i686  (安装php-pecl-memcache扩展)

6. Check if there is a memcached module

# php -m | grep memcache       //如果安安装正确,则会显示memcache的模块

yum how to install php memcached

7. Find the PHP configuration file path

If you find If you don’t have access to the php configuration file, you can use the following method: /usr/local/php/bin/php –i |grep –i php.ini. The result is as shown below:

yum how to install php memcached

Get the absolute path to the php configuration file.

8. View the memcache module, command: cd/usr/lib/php/modules

9. Manually add the memcache module to the php configuration file

Open the php configuration file, find the extension and add memcache to it, as shown in the figure below:

yum how to install php memcached

The above is the detailed content of yum how to install php memcached. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn