Problem description:
<code> 1、在win8上vmware了一个centos,并且在windows下ping通了centos的ip:192.168.1.101; 2、在windows下安装phpredis,并且在phpinfo中看到了phpredis支持的版本,证明安装成功; 3、在centos下能连上127.0.0.1:6379,正常操作redis存储; </code>
Cannot connect under Windows, prompt: Connection timed out. The code is as follows:
<code> <?php $redis = new Redis(); $redis->connect('192.168.1.101', 6379); echo "Connection to server sucessfully"; echo "Server is running: " . $redis->ping(); ?> </code>
Problem description:
<code> 1、在win8上vmware了一个centos,并且在windows下ping通了centos的ip:192.168.1.101; 2、在windows下安装phpredis,并且在phpinfo中看到了phpredis支持的版本,证明安装成功; 3、在centos下能连上127.0.0.1:6379,正常操作redis存储; </code>
Cannot connect under Windows, prompt: Connection timed out. The code is as follows:
<code> <?php $redis = new Redis(); $redis->connect('192.168.1.101', 6379); echo "Connection to server sucessfully"; echo "Server is running: " . $redis->ping(); ?> </code>
<code>vim /etc/redis.conf</code>
was modified to
<code>bind 0.0.0.0</code>
Restart the service and check the port
<code>service redis restart netstat -ntpl |grep redis</code>
You should be able to see listening 0.0.0.0