1, before wrote a PHP 5.6.27 under the blog: http://www.shuijingwanwq.com/2017/09/11/1892/, this time is PHP 7.0.22.
2, uninstall memcached, you can use the following command.
Schtasks/delete/tn memcached
3. Delete directory: c:\memcached-1.4.5.
Php memcached module
4. Open URL: https://github.com/nono303/memcached/tree/master/cygwin/x64, download: Cygevent-2-0-5.dll, cygwin1.dll, memcached-1.5.1.exe.
5. After successful download, copy to: c:\memcached-1.5.1.
Memcached php module
6. Run Windows powershell, as an administrator.
7. Execute the following command to add memcached to the Task Schedule table:
SCHTASKS/CREATE/SC onstart/tn memcached/tr "' C:\memcached-1.5.1\memcached-1.5.1.exe '-M 512"
8, open the URL: Https://github.com/nono303/PHP7-memcache-dll, select vc14.
9, view phpinfo, compiler is MSVC14, and thread safe.
10. Open URL: https://github.com/nono303/PHP7-memcache-dll/tree/master/vc14/x64/ts, download: php-7.0.x_memcache.dll.
11. Copy the Php-7.0.x_memcache.dll to: c:\php-7.0.22\ext\php_memcache.dll.
12. Add the following line in C:\php-7.0.22\php.ini to enable memcache extension.
Extension=php_memcache.dll
13. View Phpinfo,memcache already exists.
14. New Test procedure: memcached.php.
<?php
$memcache = new Memcache;
$memcache->connect(‘localhost‘, 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server‘s version: ".$version."<br/>\n";
$tmp_object = new stdClass;
$tmp_object->str_attr = ‘test‘;
$tmp_object->int_attr = 123;
$memcache->set(‘key‘, $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";
$get_result = $memcache->get(‘key‘);
echo "Data from the cache:<br/>\n";
var_dump($get_result);
?>
15, after restarting the machine, run the test program, Error: Notice:memcache::connect (): Server localhost (tcp 11211, UDP 0) failed with.
16. Open Task Scheduler, edit memcached Trigger, change from startup to login.
17. At this point, the trigger for memcached is: when any user logs on.
18, after restarting the machine, display: C:\memcached-1.5.1\memcached-1.5.1.exe command Line window, indicating the successful execution of the scheduled task.
19, run the test program, normal.
20. When the system starts, do not display the command line window, change the user or group.
21. In the pop-up Select User or Group window, we select Advanced – Find Now – Select SYSTEM, click OK.
22. When running a task, use the following user account: system.
23, after restarting the machine, does not display: C:\memcached-1.5.1\memcached-1.5.1.exe command Line window, and run the test program, Normal.
Install Memcached under Windows 10 64, install the Memcache extension for PHP 7.0.22