pdo_pgsql connection problem
am 09.06.2009 10:07:04 von maarten.foque
Dear all,
I'm running into a problem I just can't seem to get fixed. I've
searched a long time for this already but haven't found anything that
comes close to what I'm seeing.
I'm trying to connect (and later use) a postgres database through php,
using PDO.
The webserver is a recently set up server solely for testing, there is a
production server in place where everything works just fine.
The web server (test): (from phpinfo)
Linux hostname.domainname 2.6.25.11-97.fc9.x86_64 #1 SMP Mon Jul 21
01:09:10 EDT 2008 x86_64
Apache 2.0
PHP API 20041225
PHP Extension 20060613
PDO support enabled
PDO drivers pgsql, sqlite
PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 8.3.1
Module version 1.0.2
Revision $Id: pdo_pgsql.c,v 1.7.2.11.2.1 2007/01/01 09:36:05 sebastian
Exp $
The working production server is running on 32 bit, and the database
server is running fc9 x86_64 with postgres 8.3.5
The error I keep getting:
Connection failed to:pgsql:host=hostname.domainname port=5432;dbname=bla
user=username password=secret
SQLSTATE[08006] [7] could not connect to server: Permission denied\n\tIs
the server running on host "hostname.domainname" and accepting\n\tTCP/IP
connections on port 5432?
I can use psql to connect to this database and from what I've seen I'm
suspecting something wrong with pdo/pdo_pgsql or some config setting I
overlooked somewhere in apache/php.
Running tcpdump shows that nothing is even going out when trying the php
PDO connection.
Anything that can set me in the correct direction is greatly
appreciated.
kind regards,
Maarten
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: pdo_pgsql connection problem
am 09.06.2009 10:25:06 von maarten.foque
Ok,
we've found the problem:
SELINUX
for those of you who took the time reading my long question, thanks :)
regards,
Maarten
On Tue, 2009-06-09 at 10:07 +0200, Maarten Foqué wrote:
> Dear all,
>=20
> I'm running into a problem I just can't seem to get fixed. I've
> searched a long time for this already but haven't found anything that
> comes close to what I'm seeing.
> I'm trying to connect (and later use) a postgres database through php,
> using PDO.
>=20
> The webserver is a recently set up server solely for testing, there is a
> production server in place where everything works just fine.
>=20
> The web server (test): (from phpinfo)
> Linux hostname.domainname 2.6.25.11-97.fc9.x86_64 #1 SMP Mon Jul 21
> 01:09:10 EDT 2008 x86_64=20
> Apache 2.0
> PHP API 20041225=20
> PHP Extension 20060613=20
> PDO support enabled
> PDO drivers pgsql, sqlite
> PDO Driver for PostgreSQL enabled
> PostgreSQL(libpq) Version 8.3.1=20
> Module version 1.0.2=20
> Revision $Id: pdo_pgsql.c,v 1.7.2.11.2.1 2007/01/01 09:36:05 sebastian
> Exp $
>=20
> The working production server is running on 32 bit, and the database
> server is running fc9 x86_64 with postgres 8.3.5
>=20
> The error I keep getting:
> Connection failed to:pgsql:host=3Dhostname.domainname port=3D5432;dbname=
=3Dbla
> user=3Dusername password=3Dsecret
> SQLSTATE[08006] [7] could not connect to server: Permission denied\n\tIs
> the server running on host "hostname.domainname" and accepting\n\tTCP/IP
> connections on port 5432?
>=20
> I can use psql to connect to this database and from what I've seen I'm
> suspecting something wrong with pdo/pdo_pgsql or some config setting I
> overlooked somewhere in apache/php.
> Running tcpdump shows that nothing is even going out when trying the php
> PDO connection.
>=20
> Anything that can set me in the correct direction is greatly
> appreciated.
>=20
> kind regards,
> Maarten
>=20
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php