Ask the old question: what is the code of PHP used to debug

Source: Internet
Author: User
Tags php debug php error
New question: What does PHP code use to debug?
What tools do PHP code use to debug? Online has said Var_dump, but I do not understand how to use, there are any other easier way?

I am a novice, please be sure to answer the details. Thank you so much.


------Solution--------------------
1, look at the error log, but also the most direct
2. Compulsory interception of var_dump in the middle of script (); exit;
3. PHP Debug
------Solution--------------------
Echo/print_r/var_dump () is a common use for these few.

And then open the PHP error message function
------Solution--------------------
Always use
Echo '

';
Print_r ($var);
How did it break?
------Solution--------------------
Debugging?? Do not know what you use the development tools are beginners with Notepad, will be written out of the page to run, if not the results you want, you can do echo the simplest! And in general, the SQL statement will be wrong, then you echo the SQL to put the results in the database to run, to see where the error
  • 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.