Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP5: calling external functions, and logging errors
    primarykey
    data
    text
    <p>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.</p> <p>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:</p> <pre><code>&lt;?php $id = @mysql_pconnect('localhost','myusername', 'mypassword', true); print "id=".$id."\n"; ?&gt; </code></pre> <p>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?</p> <p>This has got to be a path problem somewhere. The mysql extension is built nicely at</p> <pre><code>/usr/lib/php5/20060613+lfs/mysql.so </code></pre> <p><strong>Answer:</strong></p> <p>jishi: informed me that the "@" operator suppresses output, including error messages (@echo off, anyone?)</p> <p>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:</p> <pre><code>% cat d.php &lt;?php ini_set('display_errors', true); error_reporting(E_ALL | E_NOTICE); $id = mysql_pconnect('localhost','myusername', 'mypassword', true); print "id=".$id."\n"; ?&gt; % php -c /etc/php5/apache2/php.ini d.php id=Resource id #4 </code></pre> <p>JOY!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload