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条)

报告相同问题?

悬赏问题

  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)