I have the following code running on Apache 2.2 with PHP 5.3.3:


echo "Connecting...";

$conn = mysql_connect('','root','*******') or die('Error connecting to mysql');

echo 'Connected.';

And it prints out "Connecting...", but nothing else. Doesn't even throw an error. I went through all the steps that were obvious. help?


Segfault in the php-mysql extension? I'm not sure. You might have to check your Apache logs.

Written by cdhowie

You shouldn't connect as root. You probably know it though. :-)

Accepted Answer

error_reporting(E_ALL); might sometimes not do it. Use it in combination with:

ini_set('display_errors', 1);

and see if it returns an error then :)

Written by Tjirp
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki