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

Socket error 13: Permission denied (connecting to localhost:11300) on CentOS 6.5 64bit #80

Closed
EricEric opened this issue Jan 28, 2014 · 3 comments

Comments

@EricEric
Copy link

I encounter the problem of Socket error 13: Permission denied (connecting to localhost:11300) on apache on centos 6.5, i dont know if this is a linux problem or not.

prod.ERROR: exception 'Pheanstalk_Exception_ConnectionException' with message 'Socket error 13: Permission denied (connecting to localhost:11300)' in /var/www/html/vendor/pda/pheanstalk/classes/Pheanstalk/Socket/NativeSocket.php:35
Stack trace:
#0 /var/www/html/vendor/pda/pheanstalk/classes/Pheanstalk/Connection.php(164): Pheanstalk_Socket_NativeSocket->__construct('localhost', 11300, 2)
#1 /var/www/html/vendor/pda/pheanstalk/classes/Pheanstalk/Connection.php(72): Pheanstalk_Connection->_getSocket()
#2 /var/www/html/vendor/pda/pheanstalk/classes/Pheanstalk/Pheanstalk.php(372): Pheanstalk_Connection->dispatchCommand(Object(Pheanstalk_Command_PutCommand))
#3 /var/www/html/vendor/pda/pheanstalk/classes/Pheanstalk/Pheanstalk.php(219): Pheanstalk_Pheanstalk->_dispatch(Object(Pheanstalk_Command_PutCommand))
@pda
Copy link
Collaborator

pda commented Feb 25, 2014

I've never seen a Permission denied error attempting to connect to a TCP port… and I've never used SELinux. So I'm going to go out on a limb and say it's something to do with SELinux or some similar security layer.

@pda pda closed this as completed Feb 25, 2014
@daonguyenvu
Copy link

Did you fix it? the same problem. CentOS 6,

PHP Fatal error:  Uncaught exception 'Pheanstalk\\Exception\\ConnectionException' with message 
'Socket error 13: Permission denied (connecting to x.x.x.x:11300)' in /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Socket/NativeSocket.php:40
Stack trace:
#0 /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Connection.php(169): Pheanstalk\\Socket\\NativeSocket->__construct('x.x.x.x', 11300, 2)
#1 /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Connection.php(77): Pheanstalk\\Connection->_getSocket()
#2 /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Pheanstalk.php(384): Pheanstalk\\Connection->dispatchCommand(Object(Pheanstalk\\Command\\UseCommand))
#3 /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Pheanstalk.php(335): Pheanstalk\\Pheanstalk->_dispatch(Object(Pheanstalk\\Command\\UseCommand))
#4 /var/www/html/beanstalkd/index.php(14): Pheanstalk\\Pheanstalk->useTube('testtube')
#5 {main}
  thrown in /var/www/html/beanstalkd/vendor/pda/pheanstalk/src/Socket/NativeSocket.php on line 40

Thanks much!

@lt
Copy link

lt commented Feb 16, 2016

For anyone else who stumbles on this issue, this is SELinux preventing the http user accessing the beanstalkd port.

Quick fix: sudo semanage port -a -t http_port_t -p tcp 11300

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

4 participants