[freetds] freetds with odbc not working with php5

Daniel Fazekas fdsubs at t-online.hu
Wed Jun 6 16:00:59 EDT 2007


On Jun 6, 2007, at 18:33, Riley Griffin wrote:

>  I am running Centos5.
> net.c:168:Connecting to (Server IP) port 1433.
> net.c:237:tds_open_socket: (Server IP):1433: Permission denied
> util.c:119:Changing query state from IDLE to DEAD
> token.c:2252:tds_client_msg: #20009: "Server is unavailable or does  
> not exist.".

Sounds like a SELinux issue.

Try:
man httpd_selinux

getsebool -a | grep httpd

Either
setsebool -P httpd_can_network_connect_db 1
or
setsebool -P httpd_can_network_connect 1

should do it. I think "httpd_can_network_connect_db" is more  
restrictive, if it allows port 1433 and your script can then connect,  
then that's all you needed.

> Please help me, I am new to FreeTDS but I have been looking all  
> over the place for a solution to this problem with very little luck.

Doesn't look like a FreeTDS or even a PHP problem, so you were likely  
looking in the wrong place.

Check the dmesg command's output or wherever your SELinux denials are  
logged (/var/log/messages?).

--
fds


More information about the FreeTDS mailing list