Lodius2000 Posted May 10, 2008 Share Posted May 10, 2008 i recently switched my hosting and seem to have lost a really neat function for php in the process on my old host if there was a problem on a line the page would print, Error on line 20 yadda yadda yadda, my new host does not do that it prints a blank screen if there is an error, not too good for debugging is there a way to turn that feature on or am i SOL ie, this code <?php print 'test' print 'error'; ?> when the page is loaded on my old host it returns Parse error: syntax error, unexpected T_PRINT in /home/a3108715/public_html/phpexercises/phperrortest.php on line 4 on my new host i get a blank screen thanks for the help Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/ Share on other sites More sharing options...
DarkWater Posted May 10, 2008 Share Posted May 10, 2008 error_reporting(E_ALL & ~E_NOTICE); Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537265 Share on other sites More sharing options...
Lodius2000 Posted May 10, 2008 Author Share Posted May 10, 2008 just put that in the top of the script? Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537266 Share on other sites More sharing options...
DarkWater Posted May 10, 2008 Share Posted May 10, 2008 Yeah. Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537267 Share on other sites More sharing options...
Lodius2000 Posted May 10, 2008 Author Share Posted May 10, 2008 that didn't work any other guesses, could it be something in php's configuration? Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537269 Share on other sites More sharing options...
DarkWater Posted May 10, 2008 Share Posted May 10, 2008 Yeah, it is, and that line is supposed to fix it. Are you sure you put it JUST like that? No quotes and stuff. Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537271 Share on other sites More sharing options...
Lodius2000 Posted May 10, 2008 Author Share Posted May 10, 2008 copy pasted directly to my file, by " it is" does that mean that I need to put it in a config file, if so you might have to walk me through it Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537275 Share on other sites More sharing options...
PFMaBiSmAd Posted May 10, 2008 Share Posted May 10, 2008 Blank pages are usually the result of fatal parse errors. Since your code is never executed, an error_reporting(...) statement is never executed (you also need to set display_errors on). First of all, you should not be debugging your code on a live server. The development cycle is too slow. Use a personal computer with a web server/php/mysql installed on it. Secondly, you need to set the error_reporting level and set display_errors on in php.ini or a .htaccess file if you want fatal parse errors to be displayed. Link to comment https://forums.phpfreaks.com/topic/104957-solved-php-debugging/#findComment-537281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.