22

Port 6379 is open on the server, and I can successfully run telnet localhost 6379 in SSH.

I tried both Predis/phpredis client library in PHP, but it still does not work:

  • Predis gives "Permission denied" error when opening socket to 6379.
  • phpredis gives "redis server went away".
lordlinier
  • 941
  • 1
  • 7
  • 9

1 Answers1

67

Problem solved, type:

/usr/sbin/setsebool httpd_can_network_connect=1

By default, SELinux does not allow Apache to make socket connections. More information can be found here.

Tim Post
  • 33,371
  • 15
  • 110
  • 174
lordlinier
  • 941
  • 1
  • 7
  • 9