How to debug PHP, how to check the wrong??
PHP as long as there is a little error, the entire page is not displayed, if require_once, the referenced file is wrong, also shows 500 error
I think, a experienced software engineer, also can not be in the grammar of the main error, if the page is large, not to find dead??
Share to:
------Solution--------------------
Not really.
Because if something goes wrong, the error message such as Fatal error:call to undefined function pages () and "URL" on line 48 is displayed on the Web page, and the 48th row is accurate, but I'm a mistake that PHP novice may have experienced Rarely..
------Solution--------------------
Open the error display function of PHP (at least in the debug environment you need to do so)
------Solution--------------------
① use built-in functions for troubleshooting, such as echo,var_dump,print these are common
② local breakpoint debugging with Zendstudio Xdebug plug-in
That's all I got. The pure hand hit has the wood to have!
------Solution--------------------
What is not realistic is because PHP.ini's display_error set the cause.
Also, you can see that the error log is usually written under Apache error logs.
This is generally recommended: the development environment is open for easy commissioning
On-line environment shutdown: Prevent code from being seen by others
------Solution--------------------
I am studying mainly to see the video tutorials of the Hanshunping podcast PHP teacher. Watch him in the video, to write one side of the test, so the heart more practical. So many error log usage also do not understand, only know how to write a little test must be. This will not cause the code after writing, can not run, but also a headache to find the wrong.
------Solution--------------------
You can use the Eclipse Editor to automatically prompt for any errors.
------Solution--------------------
Check the log, there will be the first few lines of error records.