Many phper do not know how to set up a Memcache development and debugging environment in Windows. Recently, I am also studying Memcache and recording the process of installing and setting up Memcache in Windows. Many phper do not know how to set up a Memcache development and debugging environment in Windows. Recently, I am also studying Memcache and recording the process of installing and setting up Memcache in Windows. (Detailed steps for installing and starting memcache in Linux)
In fact, when I started to study Memcache, I didn't know that there was a memcached for Win32 bird thing, which caused me to be able to handle it in a one-day way in the case of CEN-tos, today, I suddenly found that there is no problem in developing and debugging Memcache in Windows, so I wrote a Memcache document to share with you.
Install Memcache in Windows:
1. download the stable version of memcache for windows and decompress it to a disk, for example, in c: \ memcached
2. enter 'C: \ memcached \ memcached.exe-d install' on the terminal (that is, the cmd command interface) to install
3. enter 'C: \ memcached \ memcached.exe-d start' to start. NOTE: In the future, memcached will be used as a windows service and will be automatically started every time it is started. In this way, the server has been installed.
4. download php_memcache.dll. find the corresponding php version file by yourself.
5. add a line 'extension = php_memcache.dll 'to C: \ winnt \ php. ini'
6. restart Apache and check phpinfo. if memcache exists, the installation is successful!
Basic settings of memcached:
-P listening port-l connection IP address, the default value is local-d start to start memcached service-d restart to restart memcached service-d stop | shutdown to disable the running memcached service-d install to install memcached service-d uninstall to uninstall memcached service-u run as (only valid when running as root) -MB maximum memory usage, in MB. An error is returned when 64 MB-M memory is used up by default, instead of deleting the maximum number of concurrent connections in item-c. the default value is 1024-f. The default value is 1.25-n, key + value + flags the default value is 48-h.
Test the Memcache environment:
Run the following php file. if This is a test! is output !, Indicates that the environment is successfully set up. Start to appreciate the charm of Memcache!
< ?php$mem = new Memcache;$mem->connect("127.0.0.1", 11211);$mem->set('key', 'This is a test!', 0, 60);$val = $mem->get('key');echo $val;?>
The above is a detailed tutorial on installing Memcache in Windows. For more information, see other related articles in the first PHP community!