filbertman Posted March 31, 2007 Share Posted March 31, 2007 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). Link to comment https://forums.phpfreaks.com/topic/45074-php-downloading-in-browser-instead-of-rendering/ Share on other sites More sharing options...
MadTechie Posted March 31, 2007 Share Posted March 31, 2007 does your new Web Host provider support php ? also check the premissions Link to comment https://forums.phpfreaks.com/topic/45074-php-downloading-in-browser-instead-of-rendering/#findComment-218827 Share on other sites More sharing options...
filbertman Posted March 31, 2007 Author Share Posted March 31, 2007 PHP4 is installed as listed by phpInfo(), unless you are asking about customer support... which has been somewhat questionable so far. As for permissions, I chmodded everything to 755. Link to comment https://forums.phpfreaks.com/topic/45074-php-downloading-in-browser-instead-of-rendering/#findComment-218845 Share on other sites More sharing options...
MadTechie Posted March 31, 2007 Share Posted March 31, 2007 little weird how test.php failed to finish loading the whole page!! Link to comment https://forums.phpfreaks.com/topic/45074-php-downloading-in-browser-instead-of-rendering/#findComment-218848 Share on other sites More sharing options...
OilSheikh Posted April 1, 2007 Share Posted April 1, 2007 Use XAMPP on your local machine first and check. I usually use that. Link to comment https://forums.phpfreaks.com/topic/45074-php-downloading-in-browser-instead-of-rendering/#findComment-218919 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.