Thursday, July 1, 2010

SE Linux blocks connectivity between apache, postgres, and php

i've been having trouble with my apache/php/postgres installation on fedora core 12.

the problem was that i could not get php to connect to postgres when i executed code via the web browser. i was getting an error in the apache log that was denying the connection. if i executed the code from the command line through the php executable, it worked fine.

it turns out that SE Linux is blocking this connection. the following command (entered as root) solved the problem:
setsebool -P httpd_can_network_connect_db 1

No comments:

Post a Comment