Jump to content

[SOLVED] php debugging


Lodius2000

Recommended Posts

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

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

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.