The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with enabling postgresql in php

Discussion in 'Database Discussions' started by irdeveloper, Mar 12, 2013.

  1. irdeveloper

    irdeveloper Member

    Joined:
    Mar 12, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi everyone

    I've a big problem with enabling postgresql in php

    I'm using CPanel on a VPS , Here's the details :
    CENTOS 5.9 i686 virtuozzo – WHM 11.36.0 (build 11)

    I already installed the PostgreSQL In CPanel , And i have the Configure Postgres in the SqlServices

    Also in my hosts control panel , I've the PostgreS control panel and phpPGAdmin too
    phpPGAdmin can connect to database , And it can handle the tables
    I can create databases and create users , Assigning users at etc

    But the problem in , I can't work with postgre from Php
    Here's my Phpinfo :
    phpinfo()
    You see , There's no sign of PostgreS !

    I can't install php-pgsql from yum
    root@static [/usr/local/lib/php]# yum install php-pgsql
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: centos.psw.net
    * extras: mirror.informatik.hs-fulda.de
    * updates: centos.intergenia.de
    Excluding Packages in global exclude list
    Finished
    Setting up Install Process
    No package php-pgsql available.
    Nothing to do
    root@static [/usr/local/lib/php]#

    And when i get the installed details :
    root@static [/usr/local/lib/php]# yum info php-pgsql
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: centos.psw.net
    * extras: centos.intergenia.de
    * updates: centos.intergenia.de
    Excluding Packages in global exclude list
    Finished
    Error: No matching Packages to list
    root@static [/usr/local/lib/php]#

    I tryed to edit the yum.confd file , And reinstall the php-pgsql ,
    After reinstalling , I restart the httpd service , But again no luck

    I really need to use PostgreSQL , Please let me know if it's really possible to use it with CPanel ??

    By the way , I really love to know that hos phpPGAdmin can work with postgres , While it's extension is not loaded yet !

    Thank you .
     
  2. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    You will need to rebuild your php build from EasyApache and enable PGSQL. You should find the option at Exhaustive Options List from EasyApache setup.

    The reason why phpPGAdmin works is because cPanel might already activated the module for the cpanel internal php. If your on cPanel 11.36* you can check via : /usr/local/cpanel/3rdparty/php/53/bin/php -i|grep -i pgsql
     
  3. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    387
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    You cannot install PGSQL PHP support via yum. You have to run easyapache and select the resopective PHP module from the list.

    1. Login to server via SSH as root; now run /scripts/easyapache --force
    2. Select profile "Previously saved config **Default**" and click "Start customizing based on profile"
    3. Select the Apache version and click next step.
    4. Select the PHP Version and click next step.
    5. Scroll down to the bottom and click "Exhaustive Options List". From the list, under PHP 5.x select PGsql .Select the other ( if any )modules you wish to add;click next step
    6. Now scroll to the bottom and click "Save and Build".

    Let it to finish and when the process is complete run "php -m" from command line and make sure that PGsql support is loaded.

    Check EasyApache (Apache Update) for more details about easyapache
     
  4. irdeveloper

    irdeveloper Member

    Joined:
    Mar 12, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you guys (Techs4gnu , InterServed)

    I reinstall Apache and Php by EasyApache
    And i checked most of options to install ,
    And well , Now i can work with Postgres ,

    Well , Actually , I have to say , Really thank you :)
     
  5. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    You are more than welcome , glad to hear all worked for you.
     
Loading...

Share This Page