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.