Home > Article > Backend Development > yum how to install php memcached
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.
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:
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:
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:
//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的模块
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:
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:
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!