f



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
0
9/17/2008 11:56:02 AM
comp.lang.php 32646 articles. 0 followers. Post Follow

3 Replies
1966 Views

Similar Articles

[PageSpeed] 29

>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.
0
gordon13 (233)
9/17/2008 9:21:27 PM
> 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
0
9/17/2008 11:03:31 PM
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 -errorMode:Detailed
0
9/18/2008 1:05:52 PM
Reply:

Similar Artilces:

[Apache+PHP] Error building PHP
Hi, I am building php 4.3.10 on slackware 10.1.0 and I got an error. More in details: I've successfully installed apache_1.3.33. In php-4.3.10 directory, I typed # ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --enable-module=so and i got the following error: # ---------------------------------------- Configuring SAPI modules checking for AOLserver support... no checking for Apache 1.x module support via DSO through APXS... Sorry, I was not able to successfully run APXS. Possible reasons: 1. Perl is not installed; 2. Apache was not compiled...

About PHP::: Error/Problem PHP Warning: mysql_fetch_array():
Hi Everyone ============================================================== About PHP::: Error/Problem PHP Warning: mysql_fetch_array(): ============================================================== In the past i use my code/script work fine with Mandrake 9.1 - 10.1 ( + apache ,mysql ) Now i move to redhat EL4 with the same code/script I got error can't login to my code. and found error on /var/log/httpd/error_log like this PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/website_in_server/showdata.php or PHP Warning: my...

Apache2Triad PHP Errors without Error Messages
How do I get Apache2Triad to print the reason it stops while executing my PHP programs? ...

Getting php error logs
While developing a website, there is always a point at which I get "Connection to localhost is lost". If take a look at my server logs I see something like: [Tue Feb 1 21:32:40 2005] [notice] child pid 17914 exit signal Segmentation fault (11) Is this a coding error, or is it because I use PHP 5.0.3 and it is still buggy? How do I get more information about these Sementation faults ? Ruter -- Rutger Claes rgc@rgc.tld Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6 Do not reply to the from address. It...

form errors between php/html
I have a page that people (without technical knowledge) can upload and change news web links (via the php script) dynamically. It has worked fine on our other server, but this week we changed servers and now it doesnt. What it is doing is replicating the links (in no order - its not like my var is just getting duplicated) so that there are many duplicate links, but not all of them are. The links are stored in a textarea and when the form is submitted, the links get messed up. i have 2 other pages that are doing the same thing. (they arent links. they are just text) if i click submit,(it submit...

Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')
I installed PEAR HTTP_Upload to my new server and now im getting this error when runnign the script. any help? Maximus wrote: > I installed PEAR HTTP_Upload to my new server > and now im getting this error when runnign the script. > > > any help? > permissions problem? where is DB.php located? does DB.php reside in the include_path directories? The message is self explanatory. -- Michael Austin. DBA Consultant Donations welcomed. Http://www.firstdbasource.com/donations.html :) Try on your command line as root: >pear install DB Alex http://prepared-stateme...

When is an error not an error?
When it's OSS slopware, of course. http://www.angelfire.com/planet/dfs0/Knode_send_error.png On 2006-09-12 02:42, * DFS wrote: > When it's OSS slopware, of course. > > http://www.angelfire.com/planet/dfs0/Knode_send_error.png > Well, some time ago I had a problem with OE - too long reference line to other posts, and OE of course refused to send... then crashed. Should I name it a feature? -- Andrea On Tue, 12 Sep 2006 03:25:29 +0200, Andrea wrote: > On 2006-09-12 02:42, * DFS wrote: >> When it's OSS slopware, of course. >> >> http:/...

php and PDO Error HTTP 500
I get this http error 500 within a page when i want to connect to a postgresql database. This database is working well in command line ($ psql ...) Although i got an error message using the php script : yt@D620 /home/yt/Sites/yt_tests $ php index.php PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.' in /home/yt/Sites/yt_tests/index.php:75 Stack trace: #0 /home/yt/Sites/yt_tests/index.php(75): PDO->__construct('pgsql:dbname=yt...', 'yt', 'yvon5533') #1 {main} thrown in /home/yt/Sites/yt_tests/index.php on line 75 zsh: exit 255 php index.php line 75 being : $db = new PDO("pgsql:dbname=$dbname;host=$host;", $username, $password ); i do not got any php error when connecting thru a browser. everything is installed for PDO / PostgreSQL following my info.php page : Additional .ini files parsed /etc/php5/apache2/conf.d/curl.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_pgsql.ini, /etc/php5/apache2/conf.d/pgsql.ini, /etc/php5/apache2/conf.d/xsl.ini PDO PDO support enabled PDO drivers pgsql pdo_pgsql PDO Driver for PostgreSQL enabled PostgreSQL(libpq) Version 9.1.5 Module version 1.0.2 Revision $Id: pdo_pgsql.c 321634 2012-01-01 13:15:04Z felipe $ pgsql ...

When is an error not an error?
The Java language specification claims in: 8.8.7.1 Explicit Constructor Invocations .... "If an anonymous class instance creation expression appears within an explicit constructor invocation statement, then the anonymous class may not refer to any of the enclosing instances of the class whose constructor is being invoked." Helpfully it gives an example: "For example: class Top { int x; class Dummy { Dummy(Object o) {} } class Inside extends Dummy { Inside() { super(new Object() { int r = x; }); // error } Inside(final int y) { super(new Object() { int r = y; }); // correct } } } " Notice the word 'error' in the comment. This example compiles without error and produces the correct code. In what sense is it an 'error'? It is not a compiler error, it is not a runtime error. To quote Douglas Adams "this must be some new meaning of the word 'error' with which I am unfamiliar". Any idea what's gone wrong? In article <gepkhr$rop$1$8302bc10@news.demon.co.uk>, Anon <blackhole@nowhere.com> wrote: > The Java language specification claims in: > 8.8.7.1 Explicit Constructor Invocations [<http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.8. 7.1>] > Notice the word 'error' in the comment. This example compiles without > error and ...

PHP & Sybase Error -- php: dblib.c:303
Hi, I get errors when doing this in PHP: $db = sybase_connect("$servername:$portnumber", "$username", "$password"); $database = "master" ; sybase_select_db ( "$database" ); $q = sybase_query("sp_tables", $db); $syb_num_fields = sybase_num_fields( $q ) ; $syb_num_rows = sybase_num_rows( $q ) ; php: dblib.c:303: buffer_add_row: Assertion `row_size <= buf->element_size' failed. Aborted Any ideas? It works fine if I do SQL statements like "select * from sysobjects" but when I try to run stored procedures it dies. I even added these env vars... putenv ("SYBASE=/opt/sybase"); putenv ("SYBPLATFORM=linux"); putenv ("LD_LIBRARY_PATH=/opt/sybase/lib"); putenv ("LC_ALL=default"); putenv ("PATH=\"/opt/sybase/bin:$PATH\""); putenv ("DSQUERY=SYBASE"); Thanks in advance! -DG- On Tue, 15 Feb 2005 19:19:33 -0500, Data Goob wrote: > Hi, > > I get errors when doing this in PHP: > > $db = sybase_connect("$servername:$portnumber", "$username", "$password"); > $database = "master" ; > sybase_select_db ( "$database" ); > $q ...

php error
Hi Folks, I've tried using the PHP included with my copy of Linux, as well as recompiling and installing PHP myself, but I keep getting this error: Fatal error: Call to undefined function mysql_connect() My PHP code doesn't perform any kind of module-include of MySQL, since so far I haven't seen an example of PHP MySQL code that uses one. But is that required to get rid of this error? Thanks. 333 > I've tried using the PHP included with my copy of Linux, > as well as recompiling and installing PHP myself, but > I keep getting this error: > Fatal error: Call...

Date in Apache2's error log when error caused by PHP
I've noticed since moving from Apache1/mod_php4/linux to Apache2/mod_php5/linux that when an error is produced by PHP and put in the error_log, the date is no longer logged as well: Apache1/php4/linux example in Apache error_log: [Thu Jan 8 15:06:52 2004] [error] PHP Warning: opendir(/foo/bar/): failed to open dir: No such file or directory in /blah/something/listing.html on line 84 Apache2/php5/linux example in Apache error_log: [client 1.2.3.4] PHP Notice: Undefined variable: browserline in /foo/bar/zing.html on line 18 Is there any way to restore this, either at PHP or Ap...

Embed lots of html code in php & construc objects in php
Hi folks, I have a php file, it contains just a few php codes. The php codes I need to use is to construct an object, and use it several times, from html head until the last line of html code. I know I can construct the same object (I am using php5) several times, something like $object = new $class, and use several <?php $object->functionX ?> ... <?php $object->functionZ ?> to include php code in html code. However, to construct this object I have to call a remote server, and rely on its response, which is a bit slow. To construct it several times takes even more time, ...

SMF PHP error... Am I missing something subtle in the PHP language syntax?
Given these two code snippets, the first generates errors, the second doesn't... // generates errors $tboard = $context['linktree'][2]['name']; $tboard = empty($tboard)?'':' - '.$tboard; $ttopic = $context['linktree'][3]['name']; $ttopic = empty($ttopic)?'':' - '.$ttopic; if (! ereg($context['forum_name'], $context['page_title'])) $context['page_title'] = $context['linktree'][0]['name'].$tboard. $ttopic; // no errors $tboard = empty($context['linktree'][2]['name'])?'':' - '. $context['linktree'][2]['name']; $ttopic = empty($context['linktree'][3]['name'])?'':' - '. $context['linktree'][3]['name']; if (! ereg($context['forum_name'], $context['page_title'])) $context['page_title'] = $context['linktree'][0]['name'].$tboard. $ttopic; Here's a few sample errors that I see in my SMF log only when using the first version of the code. I think the "2" and "3" referred to are the subscripts in the code snippet... 8: Undefined offset: 3 File: /home/xxxxxx/public_html/forums/Themes/default/ Admin.template.php (main_above sub template - eval?) Line: 66 8: Undefined offset: 2 File: /home/xxxxxx/public_html/forums/Themes/default/ Admin.template.php (main_above sub template - eval?) Line: 64 For the life of me,...

Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error
hi i m unable to fugure out y I m getting this error it's a suggestion page and on submitting this page I have to reload the page but with status of the page (requires approval) in form of url earlier say few days back , it was working fine , i had absolutely no issues in this since 2-3 days everytime i submit the page , i m getting the error Error 500: ERROR: Cannot forward. Writer or Stream already obtained. Error 500 my code is listed below pls help <%@ include file="../includes/sessionChecker.jsp"%> <%@ page isThreadSafe="false" errorPage="....

PHP output errors leading to cross-browser mistakes? Mac errors but PCs are fine.
I'm facing a frustrating bug. My PHP code gets some info from a database and puts it into a select. This works fine on PCs but not on Macs. I'm thinking there is some coding error in the HTML that is causing it render wrong on the Macs? On the Macs the text is often from missing from the options elements, as you can see here: <p>Which member:</p> <select id="publicpenFormInput3" name="formInputs[cbUserName]"> <option value="x#x#x#blankx#x#x#">No choice made</option> <option value="106"></option...

parse error or infinite loop? a blank screen, yet the php error log is empty
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString", $formName); // 06-22-07 - the next commands try to import all the functions that the form // contains, so we don't get "Fatal Error: Undefined Function". $arrayOfNeededFunctions = $controller->command("matchAllPhpFunctionsInString", $formAsString); $arrayOfTrueAndFalseResults = $controller->command("loopArray", $arrayOfNeededFunctions, "getNeededFunctionsEach"); // 06-22-07 - (must end php or I get errors) $phpEnd = "?"; $phpEnd .= "> "; $formAsString = $phpEnd.$formAsString; echo "<p>in importForm: <hr> $formAsString"; eval($formAsString); The echo statement, which I just put there, shows the string about like what I'd expect. Yet, on this page, I get a blank: http://www.cyberbitten.com/my_private_page.php?formName=mp_sharing_wall_other_peoples_posts.htm A blank in the middle of the page, where I am trying to import a sub-template. Normally, if I get blank, it means that there is a parse error in the file being included. And yet, if I ssh to the server and examine the error log, it is empty. If I deliberately invoke an error on another page (in this case, weblog.php), then that appears in the error log, but no parse error does: root@ldc310:/u...

Trap server error (e.g. 404) with php
Hi, Is it possible to trap a (web)server error (e.g. 404) with php. I have one custom error page (php) for all the server errors. So i want to know with error number occurs. Regards, Robertcio My english is not that good, but hope i understood you. If you have an errorpage for all errors, you already know .htaccess files, yeah? In your .htaccess file you can refere an errorpage by doing this: ErrorDocument 404 error.php?code=404 > My english is not that good, but hope i understood you. Me either :-)) > If you have an errorpage for all errors, you already know .htaccess fi...

sql does INSERT into query browser but gets a php error
I have a SQL query that inserts into MySQL when I use the query browser but gets an error in the PHP script. I would like to try adding enclosing back ticks to the $hdrArray, because I think a reserved word like "class", that is one of the col names, may be causing the php error. I can't figure out how to get both back ticks around the $hdrArray in the implode line? I would like to try that to see if it solves the problem first because the query is right. I echoed all the variables so you could see the sequence and the INSERT error. -----------------------------ph...

HTTP Error 500 when calling mysql_connect from php script
Hello! I have installed PHP and MySql 5.0 on Win XP. Database created ok. Installation ok. PHP scripts runs ok. But when I am trying some mysql calls in the script I get an "Error 500" from explorer. // Connect to the database server echo ('Trying to connect to db'); $dbcnx = mysql_connect('localhost', 'root', ''xxxx'); The php.ini file in c:/windows has extension_dir = "C:\php\ext" and extension = php_mysql.dll and doc_root: "c:\inetpub\wwwroot What should I look for? Kp Kjell Pettersen schrieb: > Hello! > > I have installed PHP and MySql 5.0 on Win XP. IIs or Apache? > Database created ok. Installation ok. > PHP scripts runs ok. Ok. But have you set: cgi.force_redirect = 0 in php.ini? > But when I am trying some mysql calls in the script I get an "Error 500" > from explorer. > > // Connect to the database server > echo ('Trying to connect to db'); > > $dbcnx = mysql_connect('localhost', 'root', ''xxxx'); Do not use root. Create an extra user. Give the user the rights to the db and check again. > > The php.ini file in c:/windows has extension_dir = "C:\php\ext" and The only php.ini in the system? "C:\php\ext" has rights for the webserver? > extension = php_mysql.dll and > doc_root: "c:\inetpub\wwwroot And there is your script? "Olaf Schinkel" <trash@schinke...

html within php works, but php within html doesnt
Below are two different ways of writing the same script. The top one works but the bottom one displays nothing in the list. Can anyone see why? <?php echo "<select name='subcat' style='WIDTH: 95%'><option value=''>Select one</option>"; while($noticia = mysql_fetch_array($quer)) { echo "<option value='$noticia[TopicID]'>$noticia[Topic]</option>"; } echo "</select>"; ?> <select name="subcat" style="WIDTH: 95%"> <option value="">Select one</option> <?php while($noticia = mysql_fetch_array($quer)) { ?> <option value="<?php $noticia[TopicID]; ?>"><?php $noticia[Topic]; ?></option> <?php } ?> </select> Ian On Sat, 02 Sep 2006 13:19:38 GMT, "mantrid" <ian.dandav@virgin.net> wrote: ><option value="<?php $noticia[TopicID]; ?>"><?php $noticia[Topic]; >?></option> You haven't done anything in those PHP blocks; you need "print" or "echo". -- Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool DOOH! Knew it was somethin simple Cheers "Andy Hassall" <andy@andyh.co.uk> wrote in message news:gh1jf2dur1knluu2uf2mqj8r8shgu778ne@4ax.com... > On Sat, 02 Sep 2006 13:19:38 GMT, "mantrid" <ian....

even after proper error checking, I still get PHP warnings
I've this class method, which makes sure I've got a variable that is a resource: function close() { if (is_resource($this->datastoreResultsPointer)) { mysql_free_result($this->datastoreResultsPointer); mysql_close(); } } all the same, I'm getting these PHP errors: Warning: mysql_free_result(): 286 is not a valid MySQL result resource in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/McDatastoreResultsMySql.php on line 89 Warning: mysql_close(): no MySQL-Link resource supplied in /home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsI...

PHP calling TCL proc causes thousands of server errors
if (!function_exists('proper_case')) { /** * Ths function will convert a string into a proper case format using the customized TCL proc "PROPER_CASE" from the included TCL string tools libraries * * @access public * @param mixed $text * @param mixed $tclLibPath Path to TCL Library files * @param DBActionPerformer $dbAP You must generate a descendant of MethodGeneratorForActionPerformer to retrieve customized command-line formatting to call TCL shell * @return mixed $text properly formatted in Proper Case Form * @see DBActionPerformer * @uses tcl_st...

Quartus 5.0sp1 -- Error: Unexpected error in JTAG server -- error code 33
I figure I should finally ask about this problem that I've had with every Quartus version I've used (since pre-4.2): The built-in programmer in Quartus stops working after a few sessions -- always. Typically I get one or two successful programming done (using a Nios Dev kit, Cyclone ed) before it fails with: Info: Started Programmer operation at Mon Jul 11 20:54:11 2005 Error: Unexpected error in JTAG server -- error code 33 Error: Operation failed Info: Ended Programmer operation at Mon Jul 11 20:54:11 2005 At this point any attempt at programming is futile and will just repeat the error above. However, closing the programmer window/tab and relaunching Tools/Programmer makes it work again for a bit. It's really kind of annoying, but googling for a solution to the problem didn't turn up anything. While we're at it, why isn't the programmer integrated into the build instead of forcing a manual invokation? Thanks, Tommy (fpga at numba-tu.com) "Tommy Thorn" <foobar@nowhere.void> schrieb im Newsbeitrag news:QAHAe.3899$p%3.23990@typhoon.sonic.net... > I figure I should finally ask about this problem that I've had with > every Quartus version I've used (since pre-4.2): The built-in programmer > in Quartus stops working after a few sessions -- always. Typically I > get one or two successful programming done (using a Nios Dev kit, > Cyclone ed) before it fails with: > > Info: Started Prog...

Re: BIND 9
>>>>> "Elias" == Elias <elias@streamyx.com> writes: Elias> Hi BIND gurus, I've just tried using BIND 9 and have Elias> noticed something strange. Why is it that everytime my DNS Elias> server first sends out a query, the remote DNS server will Elias> respond with a format error? After getting the error reply, Elias> my server will send another query and this time it gets Elias> accepted. This is normal. It's nothing to worry about. BIND9 tries to use EDNS0 by default: essentially DNS with bigger packets and more header bits. Old servers don't support EDNS0. So they reject BIND9's EDNS0 probes, usually with a FORMERR (Format Error) because they don't understand EDNS0 packets. BIND9 then repeats this query with RFC1035-style DNS packets and makes a note to always do this when speaking to that other name server. This is also explained in the BIND9 migration notes. If BIND9's behaviour annoys you, EDNS0 can be switched off on a per-server basis with server{} statements in named.conf. Consult the ARM for more details. ...

Web resources about - ZendCore+FastCGI+IIS7 : Cannot embed PHP errors in response HTML. Always get 500 - Internal server error - comp.lang.php

Resources last updated: 3/23/2016 5:44:27 PM