Install memcache and mongodb in the php environment on windows. memcachemongodb_PHP tutorial

Source: Internet
Author: User
Install memcache and mongodb in the php environment on windows, and install memcachemongodb. Install memcache and mongodb in the php environment on windows. install memcachemongodbmangodb. download the mongodb installation file. the 64-bit windows I installed is as follows: install memcache and mongodb in the php environment on fas windows, memcachemongodb
Mangodb installation

1. download the mongodb installation file. the 64-bit windows installation file is as follows:

Https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.6.6-signed.msi

2. create a new mongodb folder on the elastic drive (such as E: \ mongodb)

3. decompress the downloaded installation file and move the extracted file to mongodb on the elastic drive.

4. create the mongodb data storage directory E: \ mongodb \ data

5. start mongodb (simple startup without configuring services)

E:\mongodb\bin\mongod.exe --dbpath  E:\mongodb\data

You can see the following information:

The installation and startup are successful.

6. enter http: // localhost: 27017/in the browser. the following message is displayed, indicating that mongdb has been started.

It looks like you are trying to access MongoDB over HTTP on the native driver port.

7. download the corresponding mongodb php plug-in (not very easy to find, if php is 5.4-5.5 version available this address: http://pan.baidu.com/s/1sjJjsYh) and configure.

8. Use in php:

try {    $mongo = new Mongo('localhost');} catch(MongoConnectionException $e) {    var_dump($e);}$mongo_db = $mongo->selectDB('logdatastorage');

Note: The above code is demo and cannot be used in the production environment.

Install memcache

1. 64-bit download

From:Http://www.urielkatz.com/archive/detail/memcached-64-bit-windows/
Download:Http://www.urielkatz.com/projects/memcached-win64/memcached-win64.zip
Source code:Http://www.urielkatz.com/projects/memcached-win64/memcached-src.rar

2. decompress the downloaded package and obtain two files: memcached.exe (server main program) and pthreadGC2.dll.

3. run the command prompt with the administrator privilege, find the decompressed path, and install the Memcached service. run the following command:

memcached.exe -d install

4. run "start"> "administrative tools"> "Windows services"> "view tools", and find the memcached service (no proof of successful installation)

5. start Memcached:

memcached.exe -m 1024 -d start

-D: Start the Daemon. the default port 11211 cannot be specified.
-M indicates the specified memory size.

6. configure Windows Firewall and add inbound rules for Memcached's default port 11211 (this step is not required if both the server and client are on the local machine)

7. test whether communication works normally. Telnet is used here:

telnet 127.0.0.1 11211

If you enter a blank doc screen, it is estimated that it is OK. The first line of command input is invisible, so I usually press enter and return an Error. it doesn't matter. This indicates that you entered an unrecognized command;

Next, check the status, type stats, and press enter:

8. download the corresponding memcache php plug-in (if php is 5.5 available this address: http://pan.baidu.com/s/1mgspf9e) and configure.

9. connection in php:

$memcache = new Memcache;$memcache->connect('127.0.0.1', 11211);
References

1. install and configure Mongodb, start and close

2. install and configure Memcached instances in Windows

Mangodb installation 1. download the mongodb installation file. the 64-bit windows installation file is as follows: https: // fas...

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.