How to Debug php programs? Gedit + Mozilla & nbsp; Firefox & lt ;? Php $ x = "1.23abc"; echo & nbsp; $ x + 7; & nbsp; & nbsp; // How to debug the above part of the program?
Gedit + Mozilla Firefox
$ X = "1.23abc ";
Echo $ x + 7;
// The program is correct.
// The following parts of the program are incorrect.
// Run this program in the browser and the result is: nothing is displayed!
$ Y = a1.0;
If ($ y)
Echo "QQ ";
?>
Use the above Notepad + browser for debugging.
If a part of the php program fails, the results of the entire program may not be displayed in the browser.
In this way, it is difficult to find program errors.
Is there any way to solve this problem?
Share:
------ Solution --------------------
Enable the php error prompt function
Set display_errors = On in php. ini and restart the server.
------ Solution --------------------
Add these two lines to your program head. you do not need to modify php. ini.
Error_reporting (E_ALL );
INI_Set ('display _ errors ', 'on ');