Differences and installation steps of memcache/memcached in 64-bit systems under win7

PHP中文网
Release: 2023-02-28 21:20:01
Original
1309 people have browsed it

This article introduces the difference between memcache and memcached and their installation steps! Hope this helps beginners!

The difference between memcache and memcached

I plan to fully apply memcached technology in my new program. It is easy to understand that memcached is a memory cache, but why is there still memcache?

It’s actually very simple, memcache is an extension of php, used for php to manage memcached, php-memcache.dll.

If memcached is installed but the extension is not installed, then PHP cannot control memcached, but there is no problem in using the command line

If the memcache extension is installed but the memcached service is not installed, then this cannot be used

Only when the memcached service and memcache extension are installed at the same time can you use memcached in PHP to improve dynamic website performance

Steps to install memcached under win7 system 64-bit:

  1. Download memcached-win32-1.4 .4-14.zip, unzip it to disk, for example D:memcached

  2. Run cmd as administrator and go to the folder where memcached is located, for example: cd d:memcached

  3. Install memcached :

     d:memcached> memcached.exe -d install

      (No prompts on the screen afterwards)

  4. Start memcached:

     d:memcached&g t;memcached.exe -d start

      (There will be no prompts on the screen afterwards, but if you check "Show all user processes" in "Task Manager", you can see that the memcached.exe process is running)

  5. memcached basic parameter settings:

    -p The listening port
    -l The IP address of the connection, the default is the local machine
    -d start Start the memcached service
    -d restart Restart the memcached service
    -d stop|shutdown Close 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 Use, unit MB. Default 64MB
    -M Returns an error when memory is exhausted instead of deleting items
    -c Maximum number of simultaneous connections, the default is 1024
    -f Block size growth factor, the default is 1.25
    -n Minimum Allocate space, key+value+flags defaults to 48
    -h displays help
    When setting parameters, you need to stop memcached first, and then use the command line to set it, such as: d:memcached> memcached.exe -m 1 -d start

  6. Stop memcached:
  7.  d:memcached> memcached.exe -d stop

  8. Uninstall memcached:
  9. cached> memcached.exe -d uninstall

Install php extension:

 memcache.dll: http://pecl.php.net/package/memcache

  Download and place it in the php/ext extension file. Then modify php.ini and add extension=php_memcache.dll

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template