Home  >  Article  >  Backend Development  >  Specific steps to configure memcache in PHP under Windows environment_PHP tutorial

Specific steps to configure memcache in PHP under Windows environment_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:07:32879browse

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 page

Check 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!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327535.htmlTechArticleFirst, you must install the php and apache environments. I use the wamp integrated package php 5.2.8 apache 2.2.1.1. After all these are ready, go to the memcache official website to download memcache under windows...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn