Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread donghe
Yes, the issue is from SELinux. thank everybody for help > [email protected] writes: You do have a point on the "Permission denied", though. If the problem was where I was suggesting, it would probably say "Connection refused". Perhaps some OS security restriction is in play here

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Tom Lane
[email protected] writes: >>> You do have a point on the "Permission denied", though. If the >>> problem was where I was suggesting, it would probably say "Connection >>> refused". Perhaps some OS security restriction is in play here. >> SELinux? I've never used it personally but have heard it

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Scott Marlowe
Way not to answer the question. On Fri, Jun 26, 2009 at 12:18 PM, wrote: > I can run this php script from commandline and psql remote access works > >> What does your connect string for each look like (with passwords bleeped >> out)? >> >> -- >> Sent via pgsql-admin mailing list (pgsql-admin@post

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread donghe
I can run this php script from commandline and psql remote access works > What does your connect string for each look like (with passwords bleeped > out)? > > -- > Sent via pgsql-admin mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mai

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Scott Marlowe
What does your connect string for each look like (with passwords bleeped out)? -- Sent via pgsql-admin mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread donghe
i use fedora 11 > >> If it was trying to get that sort of connection, rather than TCP/IP, >> the message would be different. Something like: >> >> # could not connect to server: No such file or directory >> # Is the server running locally and accepting >> # connections on Unix domain socket "

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Andy Shellam
If it was trying to get that sort of connection, rather than TCP/IP, the message would be different. Something like: # could not connect to server: No such file or directory # Is the server running locally and accepting # connections on Unix domain socket "/tmp/.s.PGSQL.5432"? Ah ye

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Carol Walter
I think that permissions on the parent directories can result in this error. Carol On Jun 26, 2009, at 1:07 PM, Kevin Grittner wrote: Andy Shellam wrote: [email protected] wrote: Unable to connect to PostgreSQL server: could not connect to server: Permission denied Is the server running

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread donghe
the default port 5432 is associated with postgres and localhost is connected # netstat -plunta | grep 5432 tcp0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 3962/postgres tcp0 0 ::1:5432:::* LISTEN 3

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Kevin Grittner
Andy Shellam wrote: > [email protected] wrote: >> 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? " > Because the error is "Permission denied", I'm gue

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Andy Shellam
Because the error is "Permission denied", I'm guessing it's permissions on the /tmp/.s.PGSQL.5432 socket that will need checking? The OP's PHP script when run standalone is probably running as root. [email protected] wrote: the error message in Apache error-log is " PHP Warning: pg_connect()

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread Kevin Grittner
wrote: > Is the server running on host "localhost" > and accepting TCP/IP connections on port 5432? Is it? Depending on your platform, you can check which ports are accepting connections with something like: netstat -plnt If you don't see your port open there, listening on all addresses

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread donghe
the error message in Apache error-log is " PHP Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server running on host "localhost" and accepting\n\tTCP/IP connections on port 5432? " > > It will be good

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-26 Thread IƱigo Martinez Lasala
Some linux distros (debian, for example) have two php.ini files, one for php scripts and a second one for Apache2 config. Perhaps you have lost one of these files... I assume you have installed mod-php for Apache. -Original Message- From: [email protected] To: [email protected]

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-25 Thread donghe
Yes, I did configured these two files, so, PHP can talk with postgres, but Apache-owned PHP can not. > On Thu, Jun 25, 2009 at 6:54 PM, wrote: >> Hi gurus! >> >> my PHP scripts don't call upon the postgres database from within HTML >> files served to web browsers by Apache, but PHP scritps itself

Re: [ADMIN] PHP cann't access to postgres databse

2009-06-25 Thread Scott Marlowe
On Thu, Jun 25, 2009 at 6:54 PM, wrote: > Hi gurus! > > my PHP scripts don't call upon the postgres database from within HTML > files served to web browsers by Apache, but PHP scritps itself can access > to database. I guess some configuration between PHP and Apache is wrong. > Do anybody have any