How to Debug php and check for errors?

Source: Internet
Author: User
Tags apache error log
How can I Debug php and check for errors ?? Php & nbsp; does not display the entire page if any error occurs. if require_once, the error of the referenced file is also displayed. I think, A software engineer with rich experience may encounter an error in the syntax owner. if the page is large, isn't it a dead man ?? How can I Debug php and check for errors ??
If a single error occurs in php, the entire page cannot be displayed. if require_once, an error occurs in the referenced file, and the 500 error is displayed.
I think a software engineer with rich experience will also encounter an error in the syntax owner. if the page is large, isn't it a dead man ?? Share:
------ Solution --------------------
Maybe not.
If an error occurs, the page displays 48th rows of error information such as Fatal error: Call to undefined function pages () in "URL" on line 48, which is very accurate, however, I am a beginner in PHP and may experience few errors ..
------ Solution --------------------
Enable the php error display function (at least in the debugging environment)

------ Solution --------------------
① Use built-in functions for troubleshooting, such as echo, var_dump, and print.
② Use the xdebug plug-in of zendstudio to debug local breakpoints

This is basically what I want!
------ Solution --------------------
The reason for setting display_error in php. ini is also unrealistic.
In addition, you can also see that the error log is generally written under the apache error log.

Generally, we recommend that you open the development environment to facilitate debugging.
Close the online environment: Prevent code from being viewed by others
------ Solution --------------------
I learned how to watch the video tutorial of the php instructor Han Shunping of Chuanzhi podcast. As he said in the video, he has to write and test it, so that his mind is more steadfast. Therefore, I do not understand the usage of many error logs. I only know how to write a test. This will not cause the code to fail to run, but also cause headaches and errors.
------ Solution --------------------
You can use the eclipse editor to automatically prompt for any errors.
------ Solution --------------------
Check the log to see the error records for the first line.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.