Install mongodb and memcache for php in windows. tutorial on mongodbmemcache_PHP

Source: Internet
Author: User
Tags install mongodb
Install mongodb and memcache and mongodbmemcache for php in windows. Install mongodb and memcache for php in windows, and install mongodbmemcachemangodb. 1. download the mongodb installation file. The windows 64-bit installation file is as follows: install mongodb and memcache for php in fastdl. mongo windows, and install mongodbmemcache

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)

The code is as follows:

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.

The code is as follows:

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:

The code is as follows:


Try {
$ Mongo = new Mongo ('localhost ');
} Catch (mongoonexception $ e ){
Var_dump ($ e );
}
$ Mongo_db = $ mongo-> selectDB ('logdatastore ');

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:

The code is as follows:

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:

The code is as follows:

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:

The code is as follows:

Telnet fig 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:

The code is as follows:


$ Memcache = new Memcache;
$ Memcache-> connect ('2017. 0.0.1 ', 127 );

Mongomangodb installation 1. download the mongodb installation file, I installed windows 64-bit, as follows: https://fastdl.mongo...

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.