Re: PHP/MySQL not playing nicely. Server drops connection.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 3, 2007, at 11:12 AM, Michael Williams wrote:

Are you sure that Apache is running and accepting connections to / ~michwill? Does a regular HTML page show up ok?

Yeah, static pages, and regular php pages load fine. It's only when I bring MySQL into the mix that things go awry.

Have you checked the server error log?

If by "server" you mean Apache or PHP specifically, then yes. There is nothing telling there.

What does your script look like where it connects? Does it simply die() without a message? Try creating a test script with header ('Content-type: text/plain') at the top. Then print out messages after each step. (beginning of script, opening a DB connection, etc.)

It literally dies with what I posted:

Safari can’t open the page “http://localhost/~michwill/mysqltest.php”; because the server unexpectedly dropped the connection, which sometimes occurs when the server is busy. You might be able to open the page later.


Oddly enough, when I use MAMP, instead of the source install, this doesn't occur.

How are you accessing the database?

I've stripped the PHP script to simply read as follows:

          <?php

            header('Content-type: text/plain');

            echo "Beginning PHP Script!";

$connection_error = "We apologize for the inconvenience, but it appears that our database server is down.<br>";
            $connection_error .= "Please try again later.";

            $host = "localhost";
            $user = "michael";
            $db_pass = "michael";

$connect = mysql_connect($host,$user,$db_pass) or die ($connection_error . mysql_error());

          ?>

. . .the error is no different, and it doesn't output anything that is "echo"ed. I've ensured that all permissions are in place with the MySQL database as well. I can manually log in just fine. I'm at a loss.




Regards,
Michael


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux