I'm using Amazon EC2 with WAMP (Windows/Apache2.2/PHP5.2.9/MySQL5.1). I have a very simple PHP routine to select some data from a database (see below -- identical code with just username/password changed).
When run from a browser, this returns a blank page with "Internet Explorer Cannot Display Webpage".
What's strange is that it works fine when I execute the PHP from the command line. I can also execute any other PHP script without a problem as long as it doesn't try to connect to MySQL. I've also successfully run the PHP through the browser on a non-EC2 box.
I've also turned on all logging I can think of --- Apache, PHP, MySQL -- and nothing appears in the logs. As well, I've set the AWS console to allow MySQL but not sure that's even relevant.
Any help would be greatly appreciated
Thanks!!
Mark
Code: Select all
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("tvan_processing", $con);
$result = mysql_query("SELECT * FROM tbl_vd_regiontoarea");
while($row = mysql_fetch_array($result))
{
echo $row['Region'] . " " . $row['Area'];
echo "<br />";
}
mysql_close($con);
?>