Requires necessary knowledge
Familiar with basic programming environment setup.
Operating environment
windows 7(64-bit);
php-5.3;
memcached-1.2.6
Download address
Environment download
What is PHP Memcache module
The Memcache module provides convenient process-oriented and object-oriented interfaces to memcached. Memcached is a resident process cache product produced to reduce the load of data from the database by dynamic web applications.
Download memcache official website PHP Memcache download address
You need to pay attention to the version number here. It depends on personal circumstances. I downloaded php_memcache-3.0.8-5.3-ts-vc9-x86.zip
Use the phpinfo() function to view the current PHP version information
Install extension
Extract the downloaded compressed package, and then copy the php_memcache.dll module to the PHP ext folder.
Modify the php.ini file
Introduce the following code
Test
Restart the web server.
Enter the following code in the memcache.php file:
<?php $memcache = new Memcache; $memcache->connect('127.0.0.1',11211); $memcache->set('key','hello memcache!'); $out = $memcache->get('key'); echo $out; ?>
Test in the browser. It should be noted that the memcache service must be started. Regarding the installation of the memcache service on the Windows platform, you can refer to an article I wrote before.
Memcache for Windows
If the above article or link is helpful to you, don’t forget to click the “Not bad” button at the end of the article or click the “Like” button in the lower right corner of the page. You can also click the "Share" floating button on the right side of the page to let more people read this article.
Due to my limited level, if there are any inaccuracies in the expression and code of the article, I welcome criticism and correction. Leave your footprints and comments are welcome.