Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2013
    Posts
    4

    Red face Unanswered: [Ubuntu 12.04] Postgresql + PHP + Apache, pg_conect() undefined

    Hi, I am really stuck. I have:

    Code:
    Apache/2.5.0-dev (Unix) OpenSSL/1.0.1 PHP/5.4.9-dev
    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
    Sep 2013
    Posts
    4
    Of course even if I put extension=php_pgsql.so, it doesn't help.

  3. #3
    Join Date
    Sep 2013
    Posts
    4
    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!

    How to make it work?

  4. #4
    Join Date
    Sep 2013
    Posts
    4
    Found a solution: recompile Apache and PHP... Useful tutorial: Apache 2.4 + PHP 5.4 + PDO_OCI on Ubuntu 12.04 HOWTO | edin.no-ip.com

Tags for this Thread

Posting Permissions

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