I'm painfully new to PHP, and was trying to set up phpBB on my local site. I have a stock debian install of apache2 and php5. The phpBB installer ran fine, connected to the database and created all its tables with no problem. But when I tried to open the login page, I got a 0-byte response.
A little digging showed that it was never making it past the call to mysql_pconnect(). The php binary just quits without error or message. Nothing at all. I tried running the following code:
<?php
$id = @mysql_pconnect('localhost','myusername', 'mypassword', true);
print "id=".$id."\n";
?>
and the "id=" string never prints. It just does nothing. I don't know where to look to see what error happened, or what is going on at all. All i've installed is "mysql" using pear... perhaps I'm missing something else?
This has got to be a path problem somewhere. The mysql extension is built nicely at
/usr/lib/php5/20060613+lfs/mysql.so
Answer:
jishi: informed me that the "@" operator suppresses output, including error messages (@echo off, anyone?)
tomhaigh: extensions must be explicitly enabled in php.ini file. After adding the line "extension=mysql.so" to php.ini, the following code runs fine:
% cat d.php
<?php
ini_set('display_errors', true);
error_reporting(E_ALL | E_NOTICE);
$id = mysql_pconnect('localhost','myusername', 'mypassword', true);
print "id=".$id."\n";
?>
% php -c /etc/php5/apache2/php.ini d.php
id=Resource id #4
JOY!