How To Install Memcached with PHP on CentOS/RHEL 7/6/5
Memcached is a distributed memory object caching system which stored data in memory on key-value basis. It is very useful for optimizing dynamic websites and enabled speed by caching objects in memory. Read more about memcache.
Read Article:
How to Set Up phpMemcachedAdmin on Linux
How To Install Memcached with PHP on Ubuntu 14.04 /12.04 LTS
This article will help you to install Memcached and PHP Memcache extension on CentOS/RHEL 7/6/5 systems.
Install Memcached Server
First we will install Memcached server on our system. Use following command to install memcached using yum package manager.
Now start Memcached service using following commands.
Install PHP with Memcache PHP Extension
Now we have installed Memcached server on our system. But to use Memcached service using php scripts we need to install Memcache php extension. So first install php and other required php modules and then use PECL to install PHP Memcache extension using following commands.
After installing php-pear package install PECL extension using command below.
Now we need to enable memcache module in php. Add following line at end of php.inifile.
Restart Apache service to enable extension
Verify Memcache Setup
Use following command to check and verify that memcached service is running fine.
Now check if memcache php extension is enabled and working properly. Create a info.php file using following code
Now access info.php on web interface and search for Memcache, You will get result like below.
Nguồn: https://tecadmin.net/
Comments
Post a Comment