Cristofer N. Reyes A.
2005-Mar-14 03:46 UTC
[Centos] Problem with conection to postgresql from php
Hi anyone!
I''ve using Centos 4.0, and I''ve a problem at the time of
connecting me
to the data base from PHP, my code is:
<?php
session_start();
session_register("session");
include("include/connect.php");
include("include/disenno.php");
?>
<html>
<head>
...
When I connect myself to the page does not show anything to me of which
it is underneath include("include/connect.php")
This file have this:
<?php
$db1 = pg_connect("dbname=db user=user password=pass host=ip");
?>
In Centos 3.4 the same configuration works well.
Any idea?
Bye!
--
Cristofer Reyes Aguilera linux-user #353991
http://www.inf.utfsm.cl/~crreyes
Laboratorio de Computacion, Departamento de Informatica, UTFSM
crreyes (at) inf (dot) utfsm (dot) cl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :
http://lists.caosity.org/pipermail/centos/attachments/20050313/caf77714/attachment-0001.bin
Did you install SELinux? Probably getting access denied.
Mike
-----Original Message-----
From: centos-bounces@caosity.org [mailto:centos-bounces@caosity.org] On
Behalf Of Cristofer N. Reyes A.
Sent: Sunday, March 13, 2005 9:46 PM
To: CentOS discussion and information list
Subject: [Centos] Problem with conection to postgresql from php
Hi anyone!
I''ve using Centos 4.0, and I''ve a problem at the time of
connecting me to
the data base from PHP, my code is:
<?php
session_start();
session_register("session");
include("include/connect.php");
include("include/disenno.php");
?>
<html>
<head>
...
When I connect myself to the page does not show anything to me of which it
is underneath include("include/connect.php") This file have this:
<?php
$db1 = pg_connect("dbname=db user=user password=pass host=ip"); ?>
In Centos 3.4 the same configuration works well.
Any idea?
Bye!
--
Cristofer Reyes Aguilera linux-user #353991
http://www.inf.utfsm.cl/~crreyes
Laboratorio de Computacion, Departamento de Informatica, UTFSM crreyes (at)
inf (dot) utfsm (dot) cl
Cristofer N. Reyes A.
2005-Mar-14 16:16 UTC
[Centos] Problem with conection to postgresql from php
On Sun, Mar 13, 2005 at 10:35:52PM -0600, Mike Kercher wrote:> Did you install SELinux? Probably getting access denied.When I had problems with apache deactivates SELinux completely, but even so I have problems with the conecci??n to postgresql from php :-( Other idea? Thanks -- Cristofer Reyes Aguilera linux-user #353991 http://www.inf.utfsm.cl/~crreyes Laboratorio de Computacion, Departamento de Informatica, UTFSM crreyes (at) inf (dot) utfsm (dot) cl -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.caosity.org/pipermail/centos/attachments/20050314/2ec6d071/attachment.bin
Cristofer N. Reyes A. wrote:>Hi anyone! > >Actually, I don''t think this is that complicated, though nice thought Mike (could be!). This is out of one of my test files for new server installs for eZ Publish... maybe it''ll help you? If you didn''t check, it''s likely that pgsql support isn''t in your php installation (unless you explicitly state that you want it, it tends not to install it). 95% of the time, this is the problem with pgsql support in 4.x (well, in the week+ since it came out -- but it''s been like 5 times!). ;-) Hope it helps... Jonathan php code (written ''off the cuff,'' since I don''t have access to my server here...): <?php /* * again, this is just done to make sure connectivity * is working between php and postgres for eZ Publish (mysql support is * also available if you want it... */ $link = |pg_connect|(''localhost'', ''root'', ''''); if (!$link) { die(''Could not connect: '' . *pg_last_error*()); } echo ''Connected successfully''; *pg_close*($link); ?>