Thread: PostgreSQL 8.1 + PHP5.1.x/4.4.2 + Apache 2.0.55/1.3.34 PROBLEM!! PLEASE HELP
Help! I was trying to make an installation of PHP 5.1.2 + Apache 2.0.55 + PostgreSQL 8.1 on Windows 2003 Server, and I'm stuck. I got PHP to work with Apache quite smoothly, so did I marry PHP with PostgreSQL - scripts connecting to the database work fine from windows command line, except that the following code: if (extension_loaded("php_pgsql")) { echo "PGSQL loaded!"; } returns no message. Still database queries work fine. Trouble starts when I try to open a page in my browser - then I get an error message like this: Error: call to udefined function pg_connect()... I changed the php.ini file a billion times, trying to figure out what to set in the "extension_dir" and "extension=php_pgsql.dll" lines, and I tried at least as many times to change apache's httpd.conf file so that the php module is loaded properly. And it is, as far as I'm concerned - the phpinfo() page shows without a problem. One peculiar thing about it is that in the "Loaded modules" section (don't remember the exact name) there's absolutely no sign of the pgsql module. I also tried downloading and installing the latest php snapshot, because someone on a forum told me it might work, but it didn't :o( I even tried earlier versions of Apache and PHP, but nothing worked. Initially I figured I must have found a bug, but I don't really believe it could've gone on for so long without being noticed by somebody... I'm begging for help, because the person I'm doing the server for strongly insists on the machine working on Win 2003 and not some distribution of linux or unix. Regards, krzysieq -- Nie przychodz! Nie przyjezdzaj! Nie dzwon! Zamow ogloszenie drobne do "Gazety Wyborczej" przez internet wchodzac na http://www.aaaby.pl/wyborczai wygraj nawet 10.000 zl!
Re: PostgreSQL 8.1 + PHP5.1.x/4.4.2 + Apache 2.0.55/1.3.34 PROBLEM!! PLEASE HELP
From
"chris smith"
Date:
On 4/27/06, belfegor666@gazeta.pl <belfegor666@gazeta.pl> wrote: > Help! I was trying to make an installation of PHP 5.1.2 + Apache > 2.0.55 + PostgreSQL 8.1 on Windows 2003 Server, and I'm stuck. I > got PHP to work with Apache quite smoothly, so did I marry PHP with > PostgreSQL - scripts connecting to the database work fine from > windows command line, except that the following code: > > if (extension_loaded("php_pgsql")) { > echo "PGSQL loaded!"; > } > > returns no message. Still database queries work fine. Trouble starts > when I try to open a page in my browser - then I get an error > message like this: > > Error: call to udefined function pg_connect()... > > I changed the php.ini file a billion times, trying to figure out > what to set in the "extension_dir" and "extension=php_pgsql.dll" > lines, and I tried at least as many times to change apache's > httpd.conf file so that the php module is loaded properly. And it > is, as far as I'm concerned - the phpinfo() page shows without a > problem. One peculiar thing about it is that in the "Loaded > modules" section (don't remember the exact name) there's absolutely > no sign of the pgsql module. you could change the first check to: if (!function_exists('pg_connect')) { die("no pg_connect"); } What does: print_r(get_loaded_extensions()); show? Anything regarding pgsql? Does your server keep logs? Maybe something in there will give you some ideas about what's going on.. -- Postgresql & php tutorials http://www.designmagick.com/
I am fighting with FreeBSD 5.4, Apache 1.3.36, php 5.1.4 and PostgreSQL 8.1.4 two days already. The PGSQL extention of php crashes everything. Trying to go back to PostgreSQL 8.0.8 to see if the problem comes from there. Please, let me know if your case is similar. Iv.
On Mon, 2006-06-05 at 14:18, pobox@verysmall.org wrote: > I am fighting with FreeBSD 5.4, Apache 1.3.36, php 5.1.4 and PostgreSQL > 8.1.4 two days already. The PGSQL extention of php crashes everything. > Trying to go back to PostgreSQL 8.0.8 to see if the problem comes from > there. > > Please, let me know if your case is similar. Most the time I've seen this, php and apache have been compiling against different versions of the same or similar libs. Last time, apache was hitting the netscape ldap libs, php was hitting the ones for openldap. Look for that kind of thing. Also, try compiling php with ONLY the postgresql extension, or the minimum you need to do initial testing, then adding them one at a time til it starts crashing again.
> Most the time I've seen this, php and apache have been compiling against > different versions of the same or similar libs. > > Last time, apache was hitting the netscape ldap libs, php was hitting > the ones for openldap. > > Look for that kind of thing. Also, try compiling php with ONLY the > postgresql extension, or the minimum you need to do initial testing, > then adding them one at a time til it starts crashing again. I did this with tracing the extensions, it seems to be the PGSQL. But I did not think about possibility to compile against different extensions. Will try to clean up on a larger scale. Thanks, Iv.