First, we need to download two files: memcached.exe and php_memcache.dll. here we need to note that the version does not match and it seems to have a problem. Download is provided below and tested to be compatible with the PHPNOW-1.5.6. Here I will compress it and provide direct download.
First, we need to download two files: memcached.exe and php_memcache.dll. here we need to note that the version does not match and it seems to have a problem. Download is provided below and tested to be compatible with the PHPNOW-1.5.6. Here I will compress and provideDirect download.
Installation steps:
- 1. decompress memcached.exe to any Directory. here, I decompress it to the PHPnow installation directory (E: \ Working \ PHPnow \ memcached.
- Run the following command in CMD:
- "E: \ Working \ PHPnow \ memcached \ memcached.exe-d install"
- Install as a system service.
- 2. run the following command in CMD:
- "E: \ Working \ PHPnow \ memcached \ memcached.exe-d start"
- Start the service.
- 3. decompress php_memcache.dll and copy it to the PHP extension directory (E: \ Working \ PHPnow \ php-5.2.14-Win32 \ ext)
- 4. add a line to the php-apache2handler.ini
- 'Extension = php_memcache.dll'
- 5. restart apache. if the restart succeeds, you can view the related information in phpinfo.
Basic settings of Memcached:
- -P listening port
- -L connected IP address. the default value is local
- -D start: start the memcached service.
- -D restart: restart the memcached service.
- -D stop | shutdown the running memcached service
- -D install the memcached service
- -D uninstall memcached service
- -U runs as the identity (only valid when running as root)
- -MB maximum memory usage, in MB. The default value is 64 MB.
- -An error is returned when M memory is used up, instead of deleting items.
- -C: maximum number of simultaneous connections. the default value is 1024.
- -F block size growth factor, default value: 1.25
- -N: Minimum allocation space. the default value of key + value + flags is 48.
- -H Show Help
Memcached environment test:
- // Tianya PHP blog http://blog.phpha.com
- $ Mem = new Memcache;
- $ Mem-> connect ("127.0.0.1", 11211 );
- $ Mem-> set ('key', 'www .phpha.com ', 0, 60 );
- $ Val = $ mem-> get ('key ');
- Echo $ val;
- ?>