How does the PHP program debug? Solution Solutions

Source: Internet
Author: User
Tags php error
How does the PHP program debug?
Gedit+mozilla Firefox


$x = "1.23ABC";
echo $x +7;
The above part of the program is right.
The following part of the program is wrong.
Run this program in the browser, and the result is: nothing is displayed!
$y =a1.0;
if ($y)

?>


Use the above Notepad + browser to debug.
If a part of the PHP program goes wrong, the result of the entire program may not be displayed in the browser.
This makes it difficult to find a program error.
Is there any way to solve this problem?

Share to:


------Solution--------------------
To turn on PHP error notification function
Set the Display_errors=on in PHP.ini, and then restart the server.
------Solution--------------------
Add these two lines to the head of your program, without modifying the 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.