Jump to content

PHP downloading in browser instead of rendering.


filbertman

Recommended Posts

I'm transferring hosts so I downloaded all my files from my old server and put them on my new server.  I set up my mySQL DB and imported the db schema.

 

However, when I try to connect to the DB, the file attempts to download instead of render (using FireFox).  Here's the odd thing, if I call phpInfo() then the page renders, but if I comment out that line, it attempts to download the page.  I stripped the page to the bare minimum and here's exactly what I have in the file (except for the login)

 

<html>

<body>

<?php

print "Hello world.<br>";

// log into mysql, open the database

$db = mysql_connect("localhost", "user", "pword") or die ('db connect failed: ' . mysql_error());

mysql_select_db("bethelcc_bethel", $db);

phpinfo();

?>

</body>

</html>

 

The page renders here:

http://bethelcc.net/test.php

 

However if i comment out the phpinfo() line, it attempts to download like this: 

http://bethelcc.net/test2.php

 

If i comment out the mysql_connect() line the page renders with an error (as expected):

http://bethelcc.net/test3.php

 

Any clues?

 

Also, if i actually do download the php file through the browser and look at it, it's empty (0 bytes).

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.