JosephLenton / PHP-Error

Better error reporting for PHP, and prettier too!
1.35k stars 151 forks source link

No nice html markup nor style, using latest php_error in combination with php 5.4 #25

Closed yolandavdvegt closed 11 years ago

yolandavdvegt commented 11 years ago

Hello.

I am using the latest version of PHP_Error grabbed from Github today.

When running the example call_via_native.php it only returns this body:

Undefined variable: b 
           D:\HostingSpaces\cms\wv.dev02.tactcms.nl\wwwroot\CMS2MVC\public\errortest.php, 6 
        #0 D:\HostingSpaces\cms\wv.dev02.tactcms.nl\wwwroot\CMS2MVC\public\errortest.php(6): php_error\ErrorHandler->php_error\{closure}(8, 'Undefined varia...', 'D:\HostingSpace...', 6, Array)
        #1 [internal function]: {closure}()
        #2 D:\HostingSpaces\cms\wv.dev02.tactcms.nl\wwwroot\CMS2MVC\public\errortest.php(9): call_user_func(Object(Closure))
        #3 {main}

There is no HTML within the response.. Does something needs to be set? or is this normal behavior?

yolandavdvegt commented 11 years ago

I have copied my project to an localhost XAMPP server and PHP_Error now works. Our real test server runs on IIS. So probably that is the problem..

JosephLenton commented 11 years ago

I have not tested on IIS, so I can only guess that this is the issue.

I will get an IIS server setup, and test it there.

yolandavdvegt commented 11 years ago

Thanks that's very nice! I know that the IIS server runs php on FastCGI. Maby that's the troublemaker

JosephLenton commented 11 years ago

Just a guess, but when PHP is run from the command line, PHP Error will become silent. This is because a lot of web developers use PHP for command line scripts, where you don't want the HTML output.

So it might be that PHP Error thinks it is running from the command line, and so goes silent.

JosephLenton commented 11 years ago

I've figured out what the problem was here, and it should now be solved.

You were right, it was due to how IIS works with FastCGI. Nothing strange, just meant it would take over the output when an error was internally reported, to give you better output. PHP Error now works around it.