dongrui6787 2015-02-04 16:48
浏览 19
已采纳

PHP 5.5显示与内容内联的错误

Test php code

<?php 
ini_set('error_reporting',E_ALL);
ini_set('display_errors','1');

echo 'test';
echo $x; //undeclared variable
echo 'test2';
?>

This code on IIS6/PHP5.3.6 outputs "test Notice: Undefined variable: x in ...\test.php on line 8 test2"

On IIS8.5/PHP5.5.21 (also running plesk 12) it outputs only the error message.

Is there any way to get it to output all content with the errror message inline with the content?

I have checked all settings (ini, iis, plesk) I could think of to no avail, is this a design change in php 5.5, or is there a setting I missed?

Thank you

P.S. This is only for debugging purposes.

  • 写回答

2条回答 默认 最新

  • duanjiong1952 2015-02-11 16:02
    关注

    I found the configuration setting that causes the changed behavior.

    It is a FastCGI configuration setting "Standard error mode" https://technet.microsoft.com/en-us/library/hh831548.aspx

    In IIS Manager, click on the server node and find the FastCGI Settings (In the IIS group), You will see one ore more defined applications, click on the php application and click 'edit' on the action menu to change the setting. (to see the errors inline with the content, select 'IgnoreAndReturn200'. (as noted in the technet document, this setting is intended for debugging purposes)

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

报告相同问题?

悬赏问题

  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”