Install Memcached under Windows 10 64, install the Memcache extension for PHP 7.0.22

Source: Internet
Author: User
Tags phpinfo schtasks



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


Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.