New users ask the old question: What is PHP code used for debugging?

Source: Internet
Author: User
Tags php debug php error
New users ask the old question: What is PHP code used for debugging? What tools are used for PHP code debugging? I have mentioned var_dump on the Internet, but I don't know how to use it. is there any simpler method?

I am a newbie. please be sure to give a detailed answer. Thank you very much.


Reply to discussion (solution)

1. check the error log, which is also the most direct
2. forcibly intercept var_dump (); exit;
3. php debug

1. check the error log, which is also the most direct
2. forcibly intercept var_dump (); exit;
3. php debug
+ 1

Echo/print_r/var_dump () are commonly used.

Then enable the php error prompt function.

Nice to use Zend studio

Zend Debugger
XDebug

Always use
Echo'

';
Print_r ($ var );
How can this problem be solved?

You need to check the information about debugging. If you want to print SQL or die ($ SQL), if you want to check whether an error is reported during program execution on the page, you can turn on the debug error switch,

Echo/print_r/var_dump () are commonly used.

Then enable the php error prompt function.

Enable the php error prompt function

How can I open this? Thank you.

I want to display a prompt when there is an error like ASP during testing. No prompt is displayed.

Nice to use Zend studio
Zend studio is an additional tool software, right?

Reference the reply from jordan102 on the third floor: echo/print_r/var_dump.

Then enable the php error prompt function.

Enable the php error prompt function

How can I open this? Thank you.

Ini_set ("display_error", On );
Error_reporting (E_ALL );

Reference the reply from kqyx_cn on the eighth floor: reference the reply from jordan102 on the third floor: echo/print_r/var_dump.

Then enable the php error prompt function.

Enable the php error prompt function

How can I open this? Thank you.

Ini_set ("display_error", On );
Error_reporting (E_ALL );
......

The ini_set function is used to modify the ini configuration file of PHP, which means to enable the display error function.
The error_reporting function is used to determine which errors are displayed. E_ALL indicates displaying all errors, including WARNING and NOTICE.

1. check the error log, which is also the most direct
2. forcibly intercept var_dump (); exit;
3. php debug

1. check the error log, which is also the most direct
2. forcibly intercept var_dump (); exit;
3. php debug
Where can I see 1?

Debugging ?? I don't know what development tool you are using. beginners use notepad to run the written webpage. if it is not the desired result, you can echo it to the simplest! In general, the SQL statement will write an error, so you can echo the SQL statement and put the result in the database for running to see where there is a mistake.

I used editplus to write code. the environment was configured with a guard suit, and there was no other software.
I started learning PHP.
Echo? For example, if an error occurs when I write a loop, which one should I echo?
Should I look for a book? You can't just read the introductory tutorial of an electronic version as you said on the internet. the tutorial does not show how to debug it.
Maybe everyone may not think of these problems as a problem. they are all simple, but they are not detailed for me, so I don't know how to proceed.

Use dreamwave

Some people know why XDEBUG has set resumable connections in ECLIPSE?


[/Img]


What is wrong with this configuration?
I also checked the port netstat-anp | grep 9001 is not in use. although I didn't listen to the breakpoint, it showed the result. Why can't I debug the breakpoint?

Having spent two days at night or not, it hurts to write a webpage.
You can't do it anymore. just insert var_drump.

I think www.php100.com has a good tutorial. you can check it out.

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.