Page 1 of 1

cannot connect to postgres through apache/browser? [SOLVED]

Posted: Thu Jul 01, 2010 9:34 am
by okie.floyd
FC 12 linux, i have apache trying to connect to postgres.

when i try to execute stuff through the browser, i get a connection error (apache error: "could not connect to server: Permission denied. Is the server running on host "localhost" and accepting. TCP/IP connections on port 5432? in /path/to/file.php on line 29, referer: http://10.0.1.2/")

but when i execute a file from the shell (aka. [myuser@localhost ]#php file.php), it all works fine.

could something be wrong with the connectors in apache? i can connect fine from psql too.

thanks

Re: cannot connect to postgres through apache/browser?

Posted: Thu Jul 01, 2010 9:53 am
by okie.floyd
finally found the fix.

this is an SE Linux issue. need to enable network database connections for apache.

this command fixed the problem

# setsebool -P httpd_can_network_connect_db 1