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