Home >Backend Development >PHP Tutorial >Specific steps to configure memcache in PHP under Windows environment_PHP tutorial
First of all, you need to install the php and apache environments.
I use the wamp integrated package
php 5.2.8
apache 2.2.1.1
After these are ready,
go to the memcache official website to download The program memcache.exe under windows
Then put it in the c:memcache directory
Open the cmd command and enter
cd c:memcache
Install
memcache.exe -p install
After installation is complete
memcache.exe -p start
After successfully opening memcache
Go to the php/ext directory and put php_memcache.dll in it
Then add a piece of content to php.ini in the php directory
extension=php_memcache.dll
After adding, restart apache
Then output phpinfo();
on the php pageCheck if memcache is loaded successfully.
If it is loaded successfully, you can do the memcache test on a php page
//phpinfo();
$memcache = new Memcache;
$memcache->connect('127.0.0.1',11211) or die('shit');
$memcache->set('key','hello memcache!');
$out = $memcache->get('key');
echo $out;
If successful, it will output
hello memcache!