Troubleshooting “Permission denied” when attempting to connect to Redis from PHP script

£可爱£侵袭症+ 提交于 2019-12-03 03:51:17

问题


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".

回答1:


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.



来源:https://stackoverflow.com/questions/8765848/troubleshooting-permission-denied-when-attempting-to-connect-to-redis-from-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!