After Ajax commits, how to debug php?

Source: Internet
Author: User
Tags google developer tools
Recently in the thinkphp website to find a problem, that is, Ajax Post/get sent to the PHP backend method, incredibly unable to debug-!

Then I searched the internet and found that Ajax---PHP is really not a good way to debug ... ( This is the point I want to ask, after Ajax commits, how to debug php?) For example, I want to see the value of a variable in PHP )

Call for help.

Reply content:

Recently in the thinkphp website to find a problem, that is, Ajax Post/get sent to the PHP backend method, incredibly unable to debug-!

Then I searched the internet and found that Ajax---PHP is really not a good way to debug ... ( This is the point I want to ask, after Ajax commits, how to debug php?) For example, I want to see the value of a variable in PHP )

Call for help.

Google developer tools, in the network XHR can see the AJAX request address, which has submitted data and background return information

Xdebuger

Google F12 will be able to see what the request no you don't have to tangle use the framework's own debugging tools

Chrome->F12 Check->NETWORK->XHR

F12 Review elements

You can write the variable to the file, and then Ajax executes to see the file, TP can use the log record directly

Add a xdebug extension, with the IDE, you can implement PHP breakpoint what.
Then the next breakpoint, you just come over and cut off the nature can debug PHP!!

The firebug of Firefox is not very good.

File_put_contents ('/log.txt ', Var_export ($_post,true));
Does not terminate the execution of the program, it outputs each acquired $_post to the Log.txt file in 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.