PHWinfo banniere

ACCUEIL ANNUAIRE ARTICLES COMPARATIF HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Go Back   PHWinfo > Forum Programmation > Scripting > comp.lang.php > ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error
Register FAQ Members List Search Today's Posts Mark Forums Read
ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error

Reply
 
Thread Tools
Old 09/17/08, 13:56   #1
guillaume.braux@gmail.com
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error

Hello,

I am running WS2008 + IIS7 + FASTCGI + ZendCore.
I have not modified the default ZendCore php.ini configuration file.
Actualy, any kind of PHP error, warning or notice gives me immediately
a IIS 500 Error (Internal Server Error).
It is a good thing in production environnement.

For debuging purposes, I want temporary to be able to see PHP warnings
and errors embedded on the html page.

So I have set "display_errors = On" on the ZC admin panel.
But nothing changes ... I still always got error 500 on pages
containing errors, warning, or notice.

But I found that if I go to the website I want to debug using
http://localhost/mypage.php (so direclty on a browser on the
production server), I got the PHP errors embedded in the html page.
But when using the ip of the server, or the host header, I got error
500.

I also tried using ISAPI instead of FastCGI. The problem is still
quite the same, but in that case, only parse errors or undefined
functions gives me Error 500. Notices and Warning are well embedded.

Here is the IIS error log when getting an Internal Server Error
(testPage is a test page containing a division by Zero Warning).

--------------------------------------
MODULE_WARNING
ModuleName FastCgiModule
Data1 FASTCGI_RESPONSE_ERROR
Data2 PHP Warning: Division by zero in C:\inetpub\wwwroot\Catalogues
\testPage.php on line 6
ErrorCode 5
ErrorCode Access is denied. (0x5)

MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName FastCgiModule
Notification 128
HttpStatus 500
HttpReason Internal Server Error
HttpSubStatus 0
ErrorCode 0
ConfigExceptionInfo
Notification EXECUTE_REQUEST_HANDLER
ErrorCode The operation completed successfully. (0x0)
--------------------------------------

Do anybody got an idea on how to get full PHP error reporing into the
HTML page with IIS7, FastCGI and Zend Core ?

Thanks,
Guillaume
  Reply With Quote
Old 09/17/08, 23:21   #2
Gordon Burditt
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error

>I am running WS2008 + IIS7 + FASTCGI + ZendCore.
>I have not modified the default ZendCore php.ini configuration file.
>Actualy, any kind of PHP error, warning or notice gives me immediately
>a IIS 500 Error (Internal Server Error).
>It is a good thing in production environnement.
>
>For debuging purposes, I want temporary to be able to see PHP warnings
>and errors embedded on the html page.


Have you tried looking at the HTML source of the page you get?

My guess is that you get a 500 error because you get PHP errors in
the middle of header info, and this makes for bad header syntax.

To see the errors, force header output *before* doing whatever it
is that draws errors.

>So I have set "display_errors = On" on the ZC admin panel.
>But nothing changes ... I still always got error 500 on pages
>containing errors, warning, or notice.

  Reply With Quote
Old 09/18/08, 01:03   #3
guillaume.braux@gmail.com
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error

> My guess is that you get a 500 error because you get PHP errors in
> the middle of header info, and this makes for bad header syntax.


I don't think the problem deals with header syntax ...
My php test page is as easy as :

<?php
$data = 0/0;
?>

I would like "PHP Warning: Division by zero in C:\inetpub\wwwroot
\Catalogues " beeing printed on the return page ... Instead of it, I
got 500 error, even with display_errors=On.
I have tested it on a "standard" LAMP server, and it works (error is
printed) ...
I also tried to process the test page directly on a console (using
"php -f mypage.php"), and the warning is well printed in the console.
So the problem seems not to come from the php interperter.

Zend is in a full default configuration state. The only param I have
changed is the display_errors config.
I tried also with PHP manualy installed from the official binaries (so
without the zend package). The problem is exacly the same ...

I am using a clean IIS7 server, and have PHP FastCgi module mapping to
the websites needing PHP support.

It may come from IIS7 or FastCGI. But where ? That is the question ...

Any more ideas ?

Guillaume
  Reply With Quote
Old 09/18/08, 15:05   #4
guillaume.braux@gmail.com
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML.Always get 500 - Internal server error

Found the solution :

You would need to set system.webServer/httpErrors/errorMode to
Detailed to do this - default is DetailedLocalOnly so as not to expose
extra information to remote clients. The following appcmd command
will achieve that.

%windir%\system32\inetsrv\appcmd.exe set config -
section:system.webServer/httpErrors -errorModeetailed
  Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 16:21.


Powered by vBulletin® ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
PHWinfo is a website Education Without Frontiers
Ad Management by RedTyger
All rights reserved
Page generated in 0.10842 seconds with 7 queries