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
Answers
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)
You can refer to: http://php.net/manual/en/function.set-error-handler.php
Example (from php website):
Which gives a example output of: