In this article we will see how we can Install MemcacheD for PHP on Ubuntu.
Memcached is very useful for increasing the site performance. There are several ways in which you can increase the site performance with MemcacheD, I have already written one of the way on this site which you can find at Save Session in Memcached.
Memcached is a standalone daemon which runs on your machine as service just like the apache.
So let’s start with installation of the memcached.
At very first we need to install Memcached service on machine. All you need to do is execute below command. You will need root privileges for the same.
By default Memcached service runs on 11211 port. You can change it to what ever you want.
So now memcached service is installed in your machine. Now if you want to make it run with the PHP then you need to Install PHP extension for Memcached.
All you need to do is perform below command in terminal.
By default Memcached service runs on 11211 port
After installing the service it’s time to reload the configuration. We can perform the same by restarting the apache. You need to perform below command.
We can get this changes in effect by restarting php service also. You need to perform below command for the same.
Once you restart the apache or PHP all you need to check you php configuration using phpinfo();. You will see below block on your configuration page.
Share if you have any comments on above process.
Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.
View all posts by: Avinash