After ajax is submitted, how can I Debug php?

Source: Internet
Author: User
The thinkphp website recently found a problem, that is, after ajaxpostget was sent to the php background method, it was impossible to debug the thinkphp website recently, after ajax post/get is sent to the php background method, it cannot be debugged --!

Then I searched the internet and found that ajax --> php really has no good way to debug ...(This is my question. how can I Debug php after ajax is submitted? For example, I want to check the value of a variable in php.)

For help

Reply content:

I recently found a problem during thinkphp website, that is, after ajax post/get is sent to the php background method, I cannot debug it --!

Then I searched the internet and found that ajax --> php really has no good way to debug ...(This is my question. how can I Debug php after ajax is submitted? For example, I want to check the value of a variable in php.)

For help

Google Developer Tool. in the network, XHR can see the ajax request address, which contains submitted data and background response information.

Xdebuger

Google F12 is enough. you don't have to worry about using the debugging tool that comes with the framework.

Chrome-> F12 check-> NetWork-> XHR

F12 review elements

You can write the variable to the file, and then run ajax to view the file. tp can directly use log records.

With an extension of xdebug and IDE, you can implement php breakpoint or something.
Next, the next breakpoint. you can Debug php after you break it down !!

Firefox's firebug is not quite good.

File_put_contents ('/log.txt', var_export ($ _ POST, true ));
// The execution of the program will not end at all, and the obtained token will be output to the log.txt file of the current directory.

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.