Install memcache_php tutorial under Windows system

Source: Internet
Author: User
Tags configuration php
About the introduction of Memcache, here is not more said, readers can refer to: memcached is what? Memcache What should I use?

(1) Install Memcache First you have to download two files, memcached installation files and php required pecl extension php_memcache.dll files, because here is the introduction under Windows install memcached, so you need to download is Memcached.exe file. Memcached.exe Specific Download address is: http://code.jellycan.com/memcached/, on this page you have to download the file named Memcached-1.2.6-win32-bin.zip. As for Php_memcache.dll, here does not provide download address, go to Baidu search it, because this must and their own PHP version of the same (the article listed below a few more common Php_memcache.dll version of the download address).

(2) The above required tools are ready, then you can start the installation and commissioning. Install Memcache first.

Unzip the downloaded Memcache package and put it under a disk, for example, in c:\memcached

Enter the "c:\memcached\memcached.exe-d Install" installation in the terminal (i.e. cmd command interface)

At this time you may not know what port you are installing memcache using, and modify the registry to change the port to the port we specified. Open Registry Editor, locate Hkey_local_machine\system\currentcontrolset\services\memcached Server, locate a ImagePath string entry, double-click it, Append write to-l 127.0.0.1-M 45-p 51321 after the item value (this means that the access IP is: 127.0.0.1 uses 45M memory, 51321 is the port), and the Registry Editor is closed after the modification.

Then enter in the command interface: "c:\memcached\memcached.exe-d start" to start the Memcache service or to find the memcached service in the computer service, reboot.

After this, let's check if the cache service Memcache is successfully installed and running. Continue in the terminal input: "Telnet 127.0.0.1 51321", enter the completion of the possible reaction, and then enter the stats, if a bunch of similar below to understand or do not understand the English, it means that the Memcache service has been successfully installed and run.

STAT PID 5636
STAT Uptime 936
STAT Time 1344915126
STAT version 1.2.6
STAT Pointer_size 32
STAT Curr_items 0
STAT Total_items 0
STAT bytes 0
STAT Curr_connections 2
STAT Total_connections 3
STAT Connection_structures 3
STAT Cmd_get 0
STAT Cmd_set 0
STAT Get_hits 0
STAT get_misses 0
STAT Evictions 0
STAT Bytes_read 19
STAT Bytes_written 7
STAT limit_maxbytes 67108864
STAT Threads 1
END

Note: If you are a win 7 system, there may be a hint that "' telnet ' is not an internal or external command, nor a program that can be run." This is because Win7 does not have the Telnet feature installed by default, so you can not use the Telnet command directly, you may go to " Control Panel "-" "program"---"Turn windows features on or off", check "Telnet client".

(3) Configure PHP. Will download the PECL module package, unzip the Php_memache.dll into the PHP directory in the EXT directory (hint: In order to prevent some unexpected errors, it is best to download and PHP version of the same module package). Then find the php.ini file, add a line inside: Extension=php_memcache.dll, and then restart the Apache server, the PHP memcache extension package is already installed.

(4) test whether the memcache can work in a PHP environment. We can do the test with the following code:

$memcache _obj = new Memcache; $memcache _obj->connect (' 127.0.0.1 ', 51321); $memcache _obj->set (' Var_key ', ' memcache test! ', memcache_compressed, '); Echo $memcache _obj->get (' Var_key ');

If the normal output "memcache test!" indicates that you have successfully set up the Memcache service for your PHP environment. Note that this may be reported as "Class ' Memcache ' not found in ..." Class error, this is tested because the extension package is inconsistent with your PHP environment, please re-download a and your PHP environment has been the expansion package on the line.

Articles you may be interested in

    • Installation and configuration tutorial for memcache under Windows
    • Sphinx installation under Windows [Support Chinese full text Search]
    • Windows 7 System Optimization acceleration method sharing
    • How to implement a PHP file under the command line under Windows
    • Master-Slave synchronous backup steps for MySQL database in Windows environment
    • Window.navigate and window.location.href the use of different explanations
    • How to install the configuration PHP Runtime environment under Windows 7
    • Win7 System slimming Optimization

http://www.bkjia.com/PHPjc/764133.html www.bkjia.com true http://www.bkjia.com/PHPjc/764133.html techarticle about the introduction of Memcache, here is not more said, readers can refer to: memcached is what? Memcache What should I use? (1) Install Memcache First you have to download two files, MEMCA ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.