OdgovorNapisal/-a faca5 » 01.01.2012 11:38:05


Na voljo so navodila v angleškem jeziku za namestitev memcached na operacijskem sistemu Windows. Membache je program, ki omogoča shranjenaje podatkov spletne aplikacije v pomnilnik. To omogoča hitrejše delovanje spletnih strani, saj ni potrebno iste informacije brati iz fizičnih datotek.

This is how I got memcache to work on my windows machine:

1.Download memcache from [url][/url] [grab the 'win32 binary' version]

2.Install memcache as a service:

Unzip and copy the binaries to your desired directory (eg. c:\memcached)
[you should see one file, memcached.exe] – thanks to Stephen for the heads up on the new version

If you’re running Vista, right click on memcached.exe and click Properties. Click the Compatibility
Near the bottom you’ll see Privilege Level, check “Run this program as an administrator”.

Install the service using the command: c:\memcached\memcached.exe -d install from the command line

Start the server from the Microsoft Management Console or by running one of the following commands:
c:\memcached\memcached.exe -d start, or net start "memcached Server"

Now that you have memcache installed, you’ll have to tie it in with PHP in order to use it.

1.Check your php extensions directory [should be something like: C:\php\ext] for php_memcache.dll
If you don’t have any luck finding it, try looking at one of these sites:
- [thanks to Henrik Gemal]
- [currently down]
- Za prikaz povezave se je potrebno prijaviti! ... mcache.dll for PHP 5.2.*
- for PHP 5.1.* [thanks, Rich]
2.Now find your php.ini file [default location for XP Pro is C:\WINDOWS\php.ini] and add this line to the extensions list:


3.Restart apache
4.Run this code to test the installation: [found on Za prikaz povezave se je potrebno prijaviti!]

$memcache = new Memcache;
$memcache->connect("localhost",11211); # You might need to set "localhost" to ""

echo "Server's version: " . $memcache->getVersion() . "<br />\n";

$tmp_object = new stdClass;
$tmp_object->str_attr = "test";
$tmp_object->int_attr = 123;

echo "Store data in the cache (data will expire in 10 seconds)<br />\n";

echo "Data from the cache:<br />\n";

If you see anything but errors, you are now using memcache!


Memcached, by default, loads with 64mb of memory for it’s use which is low for most applications. To change this to something else, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached Server in your registry, find the ImagePath entry and change it to look something like this:

“C:\memcached\memcached.exe” -d runservice -m 512

Now when you start the service via net start “memcached Server”, it will run with 512mb of memory at it’s disposal.

StudioFACA Portal
Uporabniški avatar
Prispevkov: 26153
Pridružen: 03.07.2003 09:18:02
Kraj: Slovenija

Vrni se na Programi