Directadmin CustomBuild : How to connect PostgreSQL server with php

irayan

New member
Joined
Sep 30, 2015
Messages
1
Hi
i have directadmin installed on centos 6
i want to connect to a postgresql-server via php which is on another server.

the version of my installed php is 5.3 (with mod_suphp).

The Problem is that version of my php doesn't support postgresql functions " for example : pg_connect() " i think pgsql and pdo_pgsql must be installed with php ...

i added the codes below after --with-pdo-mysql=mysqlnd \ line

--with-pgsql=pgsql \

and

--with-pdo-pgsql=pdo_pgsql \

lines to both files :

/usr/local/directadmin/custombuild/configure/suphp/configure.php53
/usr/local/directadmin/custombuild/configure/ap2/configure.php53

-----------------------------------------------
but when recompiling my php which I write this code

Code:

./build php n



it gives me error messages that


checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path



how can i fix this error ?

thanks in advance
 
Hello,

The following command

Code:
yum provides */libpq-fe.h

will show you what packages you should install before trying to compile PHP with PostgreSQL support.
.
 
Problem with postgresql

Goodmorning every one, I'm stuck on the same problem.

I need to connect php56 to postgresql but on build php n I receive the same message

checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

I tried to create custom/configure/.../ and copy configure.php56 file , edited and rebuild but custombuild seems to ignore this directory.

I located header file required in my /usr/pgsql-9.6/include dir so 1 header is present.

I tried to search and install libpq-fe.h using yum provides and the packages which contains thath header are already installed and updated.

So I'm not able to go on.

Can you help me please?
 
Solving problem

Hi
i added the codes below after --with-pdo-mysql=mysqlnd \ line

--with-pgsql=pgsql \

and

--with-pdo-pgsql=pdo_pgsql \

To solve the problem You have to change lines in php config. It should be:
--with-pdo-pgsql=<directory with pg_config> \
for me it was
--with-pdo-pgsql=/usr/pgsql-9.3/bin \

of course You need to install postgre-devel package
 
Back
Top