How to Debug php programs? Solution

Source: Internet
Author: User
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 ');

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.