doujue9767 2013-04-24 08:50
浏览 525
已采纳

在哪里可以找到PHP输出/日志

I am a beginner web developer, specifically, with PHP and some front-end techniques (HTML,CSS,JS/JQuery). I found in some situations, it's quite difficult find the bugs in PHP code. Here is one of examples:

In a HTML page, I use JQuery to submit (with post) a form to a PHP file for back-end transaction. Since I am using JQuery, the page will not be redirected to the PHP page, so if the PHP code has some bugs (even some stupid syntax / SQL errors), it can be hardly to detect them when we test them with a normal navigator.

My question is : if I use echo in the PHP page in the above case, where will the output reside ? I think there should exist some log files for all these sorts of output. What's more, if there are some bugs in the JavaScript, are there any tricks to quickly locate the bugs ?

PS: I am using PHPStorm as IDE under MAC OS.

  • 写回答

5条回答 默认 最新

  • douxin0251 2013-04-24 08:55
    关注

    When you are running AJAX (it sounds that way judging from your question), all jQuery is doing is request the page 'for you'. So instead that you can directly see the output, jQuery will 'catch' it for you. An AJAX request is nothing more than a normal HTTP request, just in the background so you won't see it.

    Therefore; when you 'echo' something, it will just be handled by jQuery and therefore sent to your browser.

    There are some tools like firebug that allow you to look into the request and response from your ajax messages, and thus displaying possible errors or different output too. It's an all-around debugger, so you can also see your rendered HTML and/or JavaScript errors.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛