Installing Memcache for PHP

To put it simply, memcache is great. If you want to increase the performance of your server then you will want to install memcache. And it’s supported by Moodle too!

Memcache works by alleviating the workload of your database server. It runs as a service and can be configured to run with PHP. I’m not going to get into the particulars of how it works, just Google “how memcache works” if you need to know more.

This article will focus on installing memcache for Windows and enabling it for Moodle.

Step 1 – Get memcache

Download memcache from http://code.jellycan.com/memcached/ (you will need the “win32 binary version”).

Step 2 – Installing memcache as a Windows service

Unzip the file and copy memcached.exe to say the C drive.
From Dos run enter this command, c:\memcached.exe -d install

Now start the service from Dos by typing this command:
net start “memcached Server”

Check your php/ext folder for the file “php_memcache.dll”

If you have it then move on, if not download it from http://pecl4win.php.net/ext.php/php_memcache.dll

Step 3 – Edit your php.ini file
Add this line to your php.ini file, or uncomment it if it”s already there:

extension=php_memcache.dll

Restart your webserver

Step 4 – Run php.info. If successful you should see memcache listed in your php.info page

Comments are closed.