Bug 214177 - PHP can connect to PostgreSQL from CLI but not from Apache
Summary: PHP can connect to PostgreSQL from CLI but not from Apache
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: 6
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-06 13:03 UTC by Tamal Kanti Nath
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-06 13:21:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
php.ini (44.08 KB, application/octet-stream)
2006-11-06 13:03 UTC, Tamal Kanti Nath
no flags Details
pg_hba.conf (3.23 KB, application/octet-stream)
2006-11-06 13:04 UTC, Tamal Kanti Nath
no flags Details
httpd.conf (33.14 KB, application/octet-stream)
2006-11-06 13:05 UTC, Tamal Kanti Nath
no flags Details
The script where I face the problem (511 bytes, application/x-php)
2006-11-06 13:14 UTC, Tamal Kanti Nath
no flags Details

Description Tamal Kanti Nath 2006-11-06 13:03:28 UTC
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:

Comment 1 Tamal Kanti Nath 2006-11-06 13:03:28 UTC
Created attachment 140460 [details]
php.ini

Comment 2 Tamal Kanti Nath 2006-11-06 13:04:40 UTC
Created attachment 140461 [details]
pg_hba.conf

Comment 3 Tamal Kanti Nath 2006-11-06 13:05:51 UTC
Created attachment 140462 [details]
httpd.conf

Comment 4 Tamal Kanti Nath 2006-11-06 13:14:27 UTC
Created attachment 140465 [details]
The script where I face the problem

Comment 5 Joe Orton 2006-11-06 13:21:37 UTC
Please try:

# setsebool -P httpd_can_network_connect 1



Note You need to log in before you can comment on or make changes to this bug.