Unable to connect to memcached server

Source: Internet
Author: User
Unable to connect to memcached server my machine has installed and configured the memcached server.

As shown in:



Then I enter the following code in the PHP program:

$ Mc = new Memcache ();

$ Mc-> connect ('2017. 0.0.1 ');


An error occurred while running. the prompt is as follows:

Notice: Memcache: connect () [memcache. connect]: Server 127.0.0.1 (tcp 11211, udp 0) failed with: unable to connect because the target machine is actively rejected.
(10061) in E: \ MyPHP \ my. php on line 4

Warning: Memcache: connect () [memcache. connect]: Can't connect to 127.0.0.1: 11211. the connection fails because the target machine actively rejects the connection.
(10061) in E: \ MyPHP \ my. php on line 4


Can you solve this problem?

Thank you.


Reply to discussion (solution)

Your Memcached service is not started

Test via telnet. if the connection fails, it is said that it has not been started.

1. ps aux | grep memcache
Check whether memcache has been started.

2. if memcache is enabled
Telnet fig 11211
See if it can be connected.

1. ps aux | grep memcache
Check whether memcache has been started.

2. if memcache is enabled
Telnet fig 11211
See if it can be connected.





Unable to connect. I did not see the memcache service among my service administrators.










Enable the memcache server first
Telnet again



Enable the memcache server first
Telnet again


I use phpstudy. I have not found memcache.exe in the phpstudydirectory.

Memcached.exe not found?
Download
Like http://www.baidu.com/link? Url = response




Enable the memcache server first
Telnet again


I use phpstudy. I have not found memcache.exe in the phpstudydirectory.



Phpstudy is an integrated package. memcache needs to be installed separately. it seems that you have not installed memcache, but the memcache extension.

You have installed the memcache extension of php but have not installed memcache.
You must install memcache for use.
: Http://www.oschina.net/p/memcached+for+win32/

Installation: http://blog.csdn.net/yuhui_fish/article/details/7762299

OK. The problem is solved. thank you.

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.