Home >Backend Development >PHP Tutorial >Specific operations for installing memcached in wamp environment
1. Download the memcache installation package, and choose the installation package for the win environment.
2. Unzip it and put it on the D drive (take D:/memcached as an example)
3. Click Start => Run => Enter cmd to enter DOS interface.
4, inputD: command enter the D drive, enter the
CD Memcachedcommand to enter the Memcached folder
5, enter Memcache.exe —D Install
command installation, enter
Start the memcached process. stop command memcached.exe -d stop, uninstall command memcached.exe -d unistall6. Enter the task manager and check the process. As shown below, the installation is successful:
7. Downloadphp_memcache.dll Extension file, put it in the binphpphp5.5.12ext directory in the wamp installation directory
8. Open php.ini and add extension=php_memcache.dll , note that there is no semicolon in front, save and restart the service
9. Create a new local project memcached, add the index.php execution file, enter the code as follows:
<?php // 初始化memcache对象 $memcache = new Memcache(); $memcache->connect("127.0.0.1", 11211); // 赋值 $memcache->add('name', 'feige', false, 60); // 获取值 $val = $memcache->get('name'); echo $val; ?>will be output if successful feige
Copyright statement: This article is the original article of the blogger and may not be reproduced without the permission of the blogger.