Unable to connect to memcached server

Source: Internet
Author: User
The memcached server is already installed and configured on my machine.

As shown in the following:



I then enter the following code in the PHP program:

$MC =new Memcache ();

$MC->connect (' 127.0.0.1 ');


An error occurred while running, prompting the following:

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 rejecting.
(10061) in E:\MyPHP\my.php on line 4

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


Excuse me, do you have a solution?

Thank you.


Reply to discussion (solution)

Your Memcached service didn't start.

Test it with Telnet, if it's not even up there, it's upstairs.

1. PS Aux|grep memcache
See if Memcache's started.

2. If the memcache has a boot
Telnet 127.0.0.1 11211
See if we can connect.

1. PS Aux|grep memcache
See if Memcache's started.

2. If the memcache has a boot
Telnet 127.0.0.1 11211
See if we can connect.





Not even in my service manager, I don't see Memcache's services.










Open Memcache Server First
Then Telnet



Open Memcache Server First
Then Telnet


I'm using phpstudy, not found in the Phpstudy directory Memcache.exe

Didn't find Memcached.exe?
Then go and download a
Like Http://www.baidu.com/link?url=puGhUYDzYEnAYdXPdxrj7h18Mh3bfX7mj8QDN6wkvHJqvCx04KtVTKeMFO3mo31Xbe4UCKIqlqpkrF7Xj5q74K.




Open Memcache Server First
Then Telnet


I'm using phpstudy, not found in the Phpstudy directory Memcache.exe



Phpstudy is an integration package bar, memcache to install another, it seems that you do not have installed Memcache, but installed the expansion of Memcache

You have installed the PHP memcache extension, but you have not installed memcache.
You need to install memcache to use.
Download Address: http://www.oschina.net/p/memcached+for+win32/

Installation method: 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.