Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant connect #433

Closed
anton000 opened this issue Feb 10, 2014 · 1 comment
Closed

Cant connect #433

anton000 opened this issue Feb 10, 2014 · 1 comment

Comments

@anton000
Copy link

Cant seem to connect to redis server.

Env

Redis Server
redis_version:2.8.4
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:4bc5e29af907c9e6
redis_mode:standalone
os:Linux 2.6.32-431.3.1.el6.i686 i686

PHP
PHP 5.4.24 (cli) (built: Jan 9 2014 07:31:54)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

CentOS release 6.5 (Final)
Linux localhost.localdomain 2.6.32-431.3.1.el6.i686 #1 SMP Fri Jan 3 18:53:30 UTC 2014 i686 i686 i386 GNU/Linux

Code

<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
var_dump($redis->ping());
?>

Error

Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in /var/www/html/api/test.php:4 Stack trace: #0 /var/www/html/api/test.php(4): Redis->ping() #1 {main} thrown in /var/www/html/api/test.php on line 4

@anton000
Copy link
Author

lol did a
/usr/sbin/getsebool -a | grep httpd
turns out SELinux wasnt allowing apache to make socket connections. upgrade from CentOS 6.4 to 6.5 somehow turned 'httpd_can_network_connect' off.
just did a
setsebool -P httpd_can_network_connect=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant