Description of problem: PHP can connect to PostgreSQL from CLI but not from Apache. Version-Release number of selected component (if applicable): php-5.1.6-3 httpd-2.2.3-5 postgresql-server-8.1.4-1.1 php-pgsql-5.1.6-3 How reproducible: Create a rele in PostgreSQL and configure the pg_hba.conf file. Configure php.ini to show the errors in the browser. Steps to Reproduce: 1. 2. 3. Actual results: Warning: pg_connect() [function.pg-connect.html]: Unable to connect to PostgreSQL server: could not connect to server: Permission denied Is the server running on host "localhost" and accepting TCP/IP connections on port 5432? in /home/tamal/public_html/pgsql.php on line 12 Expected results: <table border> <tr> <td>2006-11-06</td> </tr> </table> Additional info:
Created attachment 140460 [details] php.ini
Created attachment 140461 [details] pg_hba.conf
Created attachment 140462 [details] httpd.conf
Created attachment 140465 [details] The script where I face the problem
Please try: # setsebool -P httpd_can_network_connect 1