benluteijn / cherokee

Automatically exported from code.google.com/p/cherokee
0 stars 1 forks source link

cherokee should log or print errors from fastcgi processes even if logging type is not stderr #252

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. go to a php page with errors (syntax or otherwise) 
2. get a 500 error

What is the expected output? What do you see instead?
the syntax error if i have display_errors On in php.ini

the log should also have the syntax errors if display_errors = On

What version of the product are you using? On what operating system?
cherokee trunk on Gentoo Linux

Original issue reported on code.google.com by johnnyop...@gmail.com on 28 Nov 2008 at 9:46

GoogleCodeExporter commented 9 years ago
+1 for this issue. I ran into the same issue with mapserv running as a cgi 
process.
Mapserv generates a particular type of errors in the so called
application/vnd.ogc.se_xml xml format. On an apache server this mime type is 
offered
to me for download, cherokee only shows met the 500.

attached is the error result from apache that comes from
http://dogomaps.net/wms/test? (test.xml)

Original comment by milovand...@gmail.com on 28 Nov 2008 at 11:52

Attachments:

GoogleCodeExporter commented 9 years ago
I don't think I've got what you meant.  Check this out:

/usr/lib/cgi-bin/python-errors:
=====
#!/usr/bin/env python

import sys

sys.stdout.write ("Content-type: text/html\r\n\r\n")

sys.stdout.write ("This is content.. 1\n")
sys.stderr.write ("ERROR: Somthing has happened!\n")
sys.stdout.write ("This is content.. 2\n")
=====

This is the Cherokee output:
=====
> GET /cgi-bin/python-errors HTTP/1.1
> User-Agent: curl/7.19.0 (i386-apple-darwin9.5.0) libcurl/7.19.0 
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:1234
> Accept: */*
> 
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Keep-Alive: timeout=15
< Transfer-Encoding: chunked
< Date: Sat, 29 Nov 2008 08:25:24 GMT
< Server: Cherokee/0.12.0 (UNIX)
< Content-type: text/html
< 
This is content.. 1
This is content.. 2
* Connection #0 to host localhost left intact
* Closing connection #0
=====

And this is Apache's:
=====
> GET /cgi-bin/python-errors HTTP/1.1
> User-Agent: curl/7.19.0 (i386-apple-darwin9.5.0) libcurl/7.19.0 
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Sat, 29 Nov 2008 08:31:07 GMT
< Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l DAV/2
< Transfer-Encoding: chunked
< Content-Type: text/html
< 
This is content.. 1
This is content.. 2
* Connection #0 to host localhost left intact
* Closing connection #0
=====

Am I missing something?

Original comment by alobbs on 29 Nov 2008 at 8:37

GoogleCodeExporter commented 9 years ago
i was speaking of php parse errors. cherokee generates a 500 error instead of
printing the php parse error.  the actual parse error does not even appear in
cherokee's file logs, but it does in apache

Original comment by johnnyop...@gmail.com on 3 Dec 2008 at 6:19

GoogleCodeExporter commented 9 years ago
Are you using php as fastcgi with Apache too or as a module?.

I use "log to file" option in php.ini

Original comment by skar...@gmail.com on 3 Dec 2008 at 6:35

GoogleCodeExporter commented 9 years ago
Skarcha, that's a good work-around. :-)
However, I still think that it's a bug that we ought to fix in Cherokee.

Original comment by alobbs on 3 Dec 2008 at 7:15

GoogleCodeExporter commented 9 years ago
Hehe!... and it's safer. If your code have a bug, errors will not be showed to 
user.
You know, it can reveals physical file paths, etc... :)

Anyway, I agree, is a bug. :-)

Original comment by skar...@gmail.com on 3 Dec 2008 at 7:24

GoogleCodeExporter commented 9 years ago
I found it... Guys, set:

display_errors = On

in your php.ini

It works for me now.. O:)

Original comment by skar...@gmail.com on 3 Dec 2008 at 8:22

GoogleCodeExporter commented 9 years ago
Ops!, I didn't see that you were using "display_errors = On", sorry... O:)

However, are you sure that you have display_errors set in the right php.ini?. I 
have
tree php.ini files in my system: one for apache module, another one for php-cgi 
and
the last one for php-cli.

Original comment by skar...@gmail.com on 3 Dec 2008 at 10:36

GoogleCodeExporter commented 9 years ago
yes, very sure

Original comment by johnnyop...@gmail.com on 9 Dec 2008 at 6:52