Bug 214177 - PHP can connect to PostgreSQL from CLI but not from Apache
PHP can connect to PostgreSQL from CLI but not from Apache
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
6
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-06 08:03 EST by Tamal Kanti Nath
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-06 08:21:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Tamal Kanti Nath 2006-11-06 08:03:28 EST
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 08:03:28 EST
Created attachment 140460 [details]
php.ini
Comment 2 Tamal Kanti Nath 2006-11-06 08:04:40 EST
Created attachment 140461 [details]
pg_hba.conf
Comment 3 Tamal Kanti Nath 2006-11-06 08:05:51 EST
Created attachment 140462 [details]
httpd.conf
Comment 4 Tamal Kanti Nath 2006-11-06 08:14:27 EST
Created attachment 140465 [details]
The script where I face the problem
Comment 5 Joe Orton 2006-11-06 08:21:37 EST
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.