1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Postgresql connection problem

Discussion in 'Plesk for Linux - 8.x and Older' started by tellus, Nov 17, 2007.

  1. tellus

    tellus Guest

    0
     
    I recently had my very first customer that wanted a pgsql database (got it from the plesk addon) and everything looked good at first but the customer noticed that it was not possible to connect to the pgsql db from a php script (yes, php is compiled with --with-pgsql) but it worked fine from phppgadmin.

    I did some tests myself and for some reason it works in php scripts with:

    PHP:
    pg_connect("host='' port=5432 dbname=$dbname user=$user password=$pass")
    but not with:

    PHP:
    pg_connect("host=localhost port=5432 dbname=$dbname user=$user password=$pass")
    Why is this? Is there something I need to change to get this to work with writing "localhost" since that is the most common usage.

    Running freebsd and postgre 7.4.6
     
Loading...