Home >Backend Development >PHP Problem >How to install memcache in php 5.3.10
How to install memcache in php 5.3.10: 1. Unzip memcached to the specified directory; 2. Unzip "memcached-win32-1.4.4-14.zip"; 3. Enter cmd; 4. Unzip the corresponding zip file; 5. Modify php.ini; 6. Restart the service.
The operating environment of this article: Windows7 system, php5.3.10 version, DELL G3 computer
Install memcache under win7 php5.3.10
Because I upgraded to 5.3.10, the previous dll cannot be used. After working on it for a long time, I finally found a solution on a foreigner’s blog:
(The environment is win7 php5 .3.10 win32)
1. Unzip the memcached attachment to a certain directory. In this example, extract it in F:\
2. Unzip the memcached-win32-1.4.4-14 in the attachment. zip
3. Enter cmd, enter:
F:\memcached\memcached-win32-1.4.4-14\memcached.exe -d install
Enter
F:\memcached\memcached-win32-1.4.4-14\memcached.exe -d start
4. Unzip php_memcache-php-5.3.10.0-r2-win32-vc9-standard.zip , and copy it to php5.3.10\ext (assuming you are using the WAMP integrated environment, it should be \wamp\bin\php\php5.3.10\ext)
5. Add a line in php.ini :”extension=php_memcache.dll
6. Restart apache, open phpinfo and you will see memcache!
The test code is as follows:
<?php $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211); $memcache->set('mem_key', 'Hello Memcache!', 0, 180); $val = $memcache->get('mem_key'); echo $val; ?>
Recommended study: " PHP video tutorial》
The above is the detailed content of How to install memcache in php 5.3.10. For more information, please follow other related articles on the PHP Chinese website!