How to debug PHP files

Source: Internet
Author: User
I wrote an index. php file. after entering the url address in the browser, nothing is displayed and there is no error reminder. How can I debug it? I wrote an index. php file. after entering the url address in the browser, nothing is displayed and there is no error reminder. How can I debug it?

Reply content:

I wrote an index. php file. after entering the url address in the browser, nothing is displayed and there is no error reminder. How can I debug it?

If you confirm that the index has been reached. in php (index. php output at the beginning), but there is no response. You can check whether the status code of the page request is 404 or 500 (if the framework is used, the 500 probability is relatively high and the debugging mode is not enabled, the error is estimated to be hidden .)

ini_set("display_errors", "On");error_reporting(E_ALL | E_STRICT);

Try

If it is a relatively complete system, we recommend that you debug the logic through log. You can also directly debug the program through breakpoints.

To solve this problem, check nginx. log phperror. log to see if the program is correct.

Directly in index. php's first line,
echo 1; die;If there is output, it indicates that there is a problem with the subsequent code. You can output one row until 1 is not output.
It is estimated that the landlord should be a smart function, or the method should be named again.

Do you think too much about the upstairs,
The author said it would be an index. php
It is estimated that it is an environment problem and the php issue is resolved.

Is Thinphp core introduced ?, If both are introduced, install php and tomcat to start. You can output phpinfo () in IndexController to see the error message.

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.