Windows Memcache Installation and PHP extended configuration method _win Server

Source: Internet
Author: User
Tags ini memcached phpinfo

First, download

Find the complete Memcache Windows Installer package and unzip it on your hard drive, such as F:\memcached.exe

Second, the installation

WIN7 64-bit double hit Open this exe may only have an empty window, can not enter any command, so this exe is not used in this way. To run the CMD console, enter the F:\memcached.exe-d install installation, and then enter F:\memcached.exe-d start.

Tips: If there is no error message, then the memcached has been installed and started, and the default is to boot automatically

Third, PHP extended download and version description

You can find the complete Php_memcache.dll expansion pack on the CSDN and select the extended download link >> for your PHP version.
Note: TS refers to thread safety, NTS refers to the thread is unsafe, can be found in the PHPINFO thread safety item, if enabled is thread-safe.

Four, PHP expansion configuration

If you are using the WAMP integrated installation environment, the DLL extensions file is placed under the/wamp/bin/php/php5.5.12/ext/directory by default, and then the php.ini configuration file is modified. Add a extension=php_memcache.dll to the back of the Extension=...dll row, and then restart Apache to see if the phpinfo is memcache.

But note that the PHP configuration file under Wamp is not/wamp/bin/php/php5.5.12/php.ini, but/wamp/bin/apache/apache2.4.9/bin/php.ini, That is to say Wamp really want to use php.ini file into the folder of Apache, this place at the beginning of the most tangled. The location of the specific configuration file may be changed, in fact, the phpinfo information is the subject.

If you are modifying the PHP directory in the php.ini, you will find that the memcache extension is not loaded, phpinfo no memcache information, open the menu in the Wamp will see the php_memcache extension front has a red exclamation mark. This is because there is this DLL extension in the Ext directory, and this extension is not written in the real php.ini file. So to find the real php.ini file to add this extension

V. Code tests whether PHP has successfully extended the Memcache functionality

<?php
$mem = new Memcache;
$mem->connect ("127.0.0.1", 11211);
$mem->set (' key ', ' This is a test! ', 0);
$val = $mem->get (' key ');
Echo $val;

If successful, this is a test! will be displayed

Otherwise, "Fatal error:class ' Memcache ' not Found" is displayed. This similar error message requires you to continue to see which step is wrong, or not to open the memcache extension.

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.