How to find exceptions in the php script?-php Tutorial

Source: Internet
Author: User
How can I find errors in php scripts? I am learning php and use the Editra editor. when I run html, I often find that php scripts have no errors or execution results, how can I find out where the php script is wrong? I have added die or echo to every function in the script, and there is often no output in the content of die and echo. Is there any tool or method that can indicate which line is wrong or what is wrong? Or can I debug the php script? ---- How can I find errors in php scripts?
I am studying php and use the Editra editor. when I run html, I often find that there is no error or execution result in the php script. how can I find out where the php script is wrong? I have added die or echo to every function in the script, and there is often no output in the content of die and echo. Is there any tool or method that can indicate which line is wrong or what is wrong?
Or can I debug the php script?

------ Solution --------------------
Enable error display.

X-debug can debug php
------ Solution --------------------
Error_reporting (E_ALL );

------ Solution --------------------
How can I find out where the php script is wrong? Modify php. ini error_reporting = E_ALL &~ E_NOTICE: Restart the server.
I have added die or echo to every function in the script, and there is often no output in the content of die and echo. (I'm afraid this does not exist.) we recommend that you use a better browser, google chrome.
------ Solution --------------------
Just make sure that your syntax is correct or not.
Normally, there is no problem.
------ Solution --------------------
Discussion

Enable error display.

X-debug can debug php

------ Solution --------------------
An error is prompted. How to write your code.
------ Solution --------------------
Enable the error display function: set display_errors = Off in php. ini to a semicolon and change it to On

Enable the error level. Generally: error_reporting = E_ALL &~ You can also change E_NOTICE to another one.
------ Solution --------------------
In development mode, if you are not so sure about your code, open the error prompt.
Second, it is also very beneficial to change an Intelligent ide editing tool.
At last, we installed some auxiliary tool kits such as xdebug to improve the development efficiency and the error shooting progress.
In linux, it is still very easy to place an order for debugging or anything. in the past, I did not succeed in how to configure it in Windows.

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.