Home >Backend Development >PHP Tutorial >php memcache installation and precautions_PHP tutorial

php memcache installation and precautions_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:54:31923browse

Installing php tutorial extension: memcache steps under windows

1. Download the php extension dll: http://downloads.php.net/pierre/

2. Place the .dll under the extension directory of php, usually in the ext folder in the php directory.

3. Modify php.ini in the bin folder under the apache directory and add extension=php_memcache.dll.

4. Restart the apache server and check with phpinfo(). If memcache appears, it means the configuration is correct.

It is worth noting:

You must pay attention to the compiled version of php. When downloading memcache, be sure to use the same compiled version; for example, php is compiled with vc6, then memcache should also use the vc6 compiled version

Let’s take a look at a tutorial on downloading and installing memcache php in windows

Memcache installation under windows:
1. Download the Windows stable version of memcache, unzip it and put it in a certain disk, such as c: memcached
2. Enter ‘c:memcachedmemcached.exe -d install’ in the terminal (i.e. cmd command interface) to install
3. Then enter: ‘c:memcachedmemcached.exe -d start’ to start. note: In the future, memcached will be automatically started as a service of Windows every time you boot up. The server side has now been installed.
4. Download php_memcache.dll, please find the corresponding php version file yourself
5. Add a line ‘extension=php_memcache.dll’ to c:winntphp.ini
6. Restart apache, and then check phpinfo. If there is memcache, it means the installation is successful!


Basic settings of memcached:

-p listening port
-l The IP address of the connection, the default is the local computer
-d start starts memcached service
-d restart restart memcached service
-d stop|shutdown shut down the running memcached service
-d install install memcached service
-d uninstall uninstall memcached service
-u Run as (only valid when running as root)
-m Maximum memory usage, unit MB. Default 64mb
-m Return an error when memory is exhausted instead of deleting items
-c Maximum number of simultaneous connections, default is 1024
-f block size growth factor, default is 1.25
-n minimum allocated space, key+value+flags default is 48
-h show help

memcache environment test:
Run the following php file. If this is a test! is output, it means the environment is set up successfully. Start to appreciate the charm of memcache!

< ?php
$mem = new memcache;
$mem->connect(”127.0.0.1′, 11211);
$mem->set(’key’, ‘this is a test!’, 0, 60);
$val = $mem->get(’key’);
echo $val;
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632305.htmlTechArticleInstalling php tutorial extension: memcache under windows Step 1. Download the php extension dll: http://downloads. php.net/pierre/ 2. Put the .dll under the extension directory of php, usually under the ext file in the php directory...
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