On our last article we have discussed about
server side javascript Node.js. Today I am going to explain you how to install Memcache in Windows system. Presently a days, loads of notable sites like Facebook, Twitter, Digg, Youtube are utilizing open source, high performance distributed memory object caching. Which is
known as Memcached. Mostly people are comfortable with windows and they are intrigued to create application in
windows environment only. So here is an article to tell you the best way to install Memcached into Windows 7 (WAMP).
I am using WAMP server 2.1 and
PHP version 5.3 in my system. I am going to tell you in step by step process.
Step 1 :
First of all you need to
download memcached-1.2.6-win32-bin.zip.
I search a lot and at last
got the appropriate package, which you can download from here.
Step 2 :
Then you need to unzip the package and you will get memcached.exe.
Now what you need to do is, paste it in your directory. I have paste it in my
E:\memcache\memcached.exe. and my wamp server also in E drive.
Step 3 :
Now open the folder and right click on the memcached.exe and run as administrator. As we are utilizing Windows you can easily find out that option when you right click on the memcached.exe.
Now open the folder and right click on the memcached.exe and run as administrator. As we are utilizing Windows you can easily find out that option when you right click on the memcached.exe.
Step 4:
Now it’s time to install the memcached in server. To do that, Just open
your command prompt as administrator settings and type the path of your executable
file and space and –d install then hit enter.
For your reference ,
D:\> your
path memcached.exe –d start
For further reference look at the screenshot which I
added below,
You may face a error as below screenshot “The
program can't install because MSVCR71.dll is missing from your computer .“
Step 5 :
In order to solve this issue you
have to download the MSVCR71.dll
file. I have searched a lot for the right version and finally found it. You can download it from here. Once downloaded the dll file and paste it inside system32 folder (c:\Windows\system32). Now go to the command prompt where installation is in progress and hit enter. If you are not getting any error meaning that memcached has been installed successfully.
Step 6 :
Once you have installed memcached in your system, go to control panel. Find out the memcached service and start the service. Otherwise you can open command prompt and type start memcached server. You will get a success message.
Step 7 :
At long last you need to change setup in php.ini file to make memcached to work with PHP.
Then only php will able to recognise memcached server. To do this you need php_memcached.dll. You can download it from here.
That’s all! We are done. Now
restart your WAMP server. Your memcached is ready to use and it will boost up the application performance.
Hope this tutorial is useful. Please do not forget to leave your valuable comments below and share it with your friends. Also let me know if you are facing any issue to follow these instructions. Subscribe to our blog.
I have also drafted "How to use memcached with PHP?" for my next article.
Hi Sanjoy,
ReplyDeleteI installed the memcache successfully as per your tutorial but still its showing me the following error:
Fatal error: Class 'Memcache' not found in \wamp\www\projectname\application\Bootstrap.php on line 160
I'm using
PHP 5.3.9
Wampserver 2.2
and
Zend Framework
Please help how can I deal with this issue.
Hi !
DeleteTo be honest currently I don't have any idea about how to configure memcache class with zend framework. I guess zend is having the inbuilt class to provide caching system.
Please follow the class which i provided in my next article. You need to create the class called Memcache and then using that class u need to perform your operation. If you created the above class in your server then just check the file path correctly.
Hope this will solve your problem.
With Thanks & Regards,
Sanjay
Thanks filled in in the missing pieces for me!
ReplyDeletethanks for the great article!!!
ReplyDelete