Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#5834 - php 5.2 fatal error pg_connect ...

Attached to Project: Arch Linux
Opened by Cheikh (Cheikh) - Tuesday, 14 November 2006, 21:12 GMT
Task Type Support Request
Category Packages: Current
Status Closed
Assigned To No-one
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I am getting this error when I try to connect to my database Fatal error: Call to undefined function pg_connect()...
The same piece of codes have worked without any changes to previous versions of php. A quick google search has reveiled that is most likely that php was not correctly build with PostgreSQL. I may be wrong though this is my code to connect.

<?php
// Database host
$db_host = "localhost";
// Database user
$db_user = "username";
// Database password
$db_pswd ="password";
// Database name
$db_name = "mydbname";

// Connect to the database
$pg = pg_connect("host=$db_host user=$db_user password=$db_pswd
dbname=$db_name") or die ("Can't connect to database");
?>

This task depends upon

Closed by  Thomas Bächler (brain0)
Friday, 17 November 2006, 16:25 GMT
Reason for closing:  Not a bug
Comment by Roman Kyrylych (Romashka) - Wednesday, 15 November 2006, 19:05 GMT
Are you sure that you uncommented ;extension=php_pgsql.so in your php.ini? (I ask because you didn't mention that)
Comment by Cheikh (Cheikh) - Thursday, 16 November 2006, 03:03 GMT
I dont have ;extension=php_pgsql.so in my /etc/php.ini file, but If you meant extension=pgsql.so I do have it and it is uncommented. If naming scheme has changed I am not aware of if.
Thanks
Comment by Cheikh (Cheikh) - Friday, 17 November 2006, 16:22 GMT
Problem solved in my /etc/php.ini file the extension_dir was pointing to an old /usr/lib/php/extensions/no-debug-non-zts-20050922" directory
instead of /usr/lib/php/extensions/no-debug-non-zts-20060613"
The same problem caused my apache server to stop working a quick "diff /etc/php.ini /etc/php.ini.pacnew" showed the problem.

My bad my own mistake.

Loading...