php and me don't get alone... help?
Madison Kelly
linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Nov 30 17:04:11 UTC 2006
Jamon Camisso wrote:
> Madison Kelly wrote:
>> Hi all,
>>
>> I am trying to setup a tiny test script on Debian
>> Sarge/Apache2/PostgreSQL 8.1/PHP5. Problem is, php5 doesn't have
>> support for pg_connect (get the error "Fatal error: Call to undefined
>> function pg_connect() in /var/www/html/index.php on line 2").
>> Apparently pgsql support is specifically excluded by default?
>
> It may be the case that you need libapache2-mod-php5. Not sure if it
> gets installed as a dependency or not. Before you do that, try checking
> php and apache to see that they work together:
>
> <?php phpinfo(); ?>
>
> You should be able to find a section called pgsql.
>
>> I've installed 'php5-pgsql', ran 'dpkg-reconfigure php5-pgsql', made
>> sure 'extension=pgsql.so' was in '/etc/php5/apache2/php.ini' and
>> restarted Apache and PostgreSQL. I've tried with and without a
>> password on the pgsql user... Still no luck though.
>>
>> Is this why PHP/MySQL are so popular together?
>>
>> Here is my script, in all it's glory:
>>
>> <?php
>> $dbh=pg_connect("dbname=phpbb_mb user=digimer password=secret") or
>> die("Couldn't Connect ".pg_last_error());
>> ?>
>>
>> Crazy complex, no? *sigh* Anyone have any idea what the heck I am
>> doing wrong mind hitting me a clue-stick?
>
> Dependency for the apache module or perhaps (unlikely, or rather, no
> clue if it matters) your script needs to be owned by www-data?
>
> Jamon
I have no idea why, but it started working... I wish I could point to
why. This really doesn't endear me to PHP. Why are all the good BBS
forums written in PHP? *sigh*. Anyway, I'm up and running so there ya
go. Thanks kindly for your reply!
Madi
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list