Results 1 to 7 of 7

Thread: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

  1. #1
    Join Date
    Feb 2009
    Beans
    9

    [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Hi, I am really stuck. I have installed:

    Code:
    Apache/2.5.0-dev (Unix) OpenSSL/1.0.1 PHP/5.4.9-dev
    (Yes, I have to have exactly these versions of Apache and PHP)

    Problem:

    Code:
    Fatal error: Call to undefined function pg_connect()
    I have installed php5-pgsql as well as postgresql and postgresql-client. I need postgresql, but I can't use it... I thought there was a problem with LibPQ, so I tried to force it by putting "LoadModule PATH/libpq.so" but Apache says that the module has already been loaded.

    If I try to uncomment "extension=php_pgsql.dll" in php.ini it shows that the file does not exist (the same happens for php_pdo_pgsql file) and when I tried to find it, the find command only showed me that "php_pgsql.h" exists.

    Could you please help me? I am out of ideas.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,682
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Create a file called something like "info.php" in /var/www with just the contents:
    Code:
    <?php phpinfo() ?>
    Now browse to that file; you wlll see a complete list of all the modules running in PHP. Are the pgsql modules installed?
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Feb 2009
    Beans
    9

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Of course I did that, that was the first thing I did. No, pgsql modules are not loaded, surprisingly sqlite PDO modules are loaded, but neither have I installed them nor have I enabled this extension.

    I am sure which php.ini I am editing because phpinfo says:

    Loaded Configuration File /usr/local/apache2/conf/php.ini

  4. #4
    Join Date
    Feb 2009
    Beans
    9

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Hi, does anyone have any clue or has faced the same problem?

  5. #5
    Join Date
    Feb 2009
    Beans
    9

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Of course even if I put extension=php_pgsql.so, it doesn't help.

  6. #6
    Join Date
    Feb 2009
    Beans
    9

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Thanks SeijiSensei for writing anything and generally thank you everyone for no help at all. I got used to it on this forum.

    For the record, I have not resolved this particular issue. There is one thing however - pgsql is not included when php is ran by webserver. If I run it from CLI and check php -i.... the php_pdo_pgsql and php_pgsql are both loaded!

    If you happen to know how to make it work, please, be so kind and reply. Any kind of input is priceless.

  7. #7
    Join Date
    Feb 2009
    Beans
    9

    Re: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Solution: just recompile Apache and PHP.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •