Home >Backend Development >PHP Tutorial >Configure memcached in Windows environment php memcached java memcached official website redis memcached comparison

Configure memcached in Windows environment php memcached java memcached official website redis memcached comparison

WBOY
WBOYOriginal
2016-07-29 08:54:101088browse

memcached needs no introduction--

1: Install memcached server software under Windows, have downloaded and uploaded the cloud disk---Portal Remember to bring the key: ykrc

After decompression, there is an installation tutorial in the installation instructions. .

2: The software is installed in the server host, so PHP needs an extension to connect to memcached. This extension is memcache.dll. It is also downloaded and uploaded to the cloud disk - Helicopter. Remember to bring gasoline: ee5g

After decompression, you can Seeing many extensions corresponding to the PHP version, you need to choose the extension corresponding to your current PHP version, including thread-safe and non-thread-safe, x86 or x64.

Copy your corresponding extension to the extension storage folder set in the php configuration file, usually the ext file in the installation directory, and throw it in!

Then add extension=php_memcache.dll to the configuration file, restart the server software to take effect, and now you can use it happily

3: If you are prompted for a non-win32 application or the extension cannot be recognized or other unknown errors, please double-check whether you have selected the corresponding one. extension.

4: Use demo: If the value is output normally, the installation is successful

<span>1</span> <?<span>php
</span><span>2</span><span>3</span><span>$memcache_obj</span> = memcache_connect('localhost', 11211<span>);
</span><span>4</span><span>$memcache_obj</span>->set('key','value'<span>);
</span><span>5</span><span>$value</span>=<span>$memcache_obj</span>->get('key'<span>);
</span><span>6</span><span>echo</span><span>$value</span>;

The above introduces the configuration of memcached php in Windows environment, including the content of Memcached. I hope it will be helpful to friends who are interested in PHP tutorials.

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