Why are there no real error reports from the CGI scripts???

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
carl_mcdade
-


Joined: 25 Jun 2004
Posts: 4

PostPosted: Fri Jun 25, 2004 12:06 pm    Post subject: Why are there no real error reports from the CGI scripts??? Reply with quote

Abyss is not really developer friendly if it can't return the real CGI execution error. The error 200 page is very annoying and does not help when building a 1500 line script and needing only a line number to find a syntax error.

Is there anyway to improve this?
Back to top View user's profile Send private message
aprelium-beta
-


Joined: 24 Jun 2004
Posts: 383

PostPosted: Fri Jun 25, 2004 10:53 pm    Post subject: Re: Why are there no real error reports from the CGI scripts Reply with quote

carl_mcdade wrote:
Abyss is not really developer friendly if it can't return the real CGI execution error. The error 200 page is very annoying and does not help when building a 1500 line script and needing only a line number to find a syntax error.

Is there anyway to improve this?

Error 200 is not a "real" error. It only means that everything went fine but that your script sent no output (except the CGI headers.) So add a little "echo" or "print" statement in your code to get rid of it. It is as if you write a program that sends nothing to the screen. How can the screen help you debug you bad coding logic in this situation? (in our analogy, the screen is Abyss.)
Do a search for "Error 200" in the forum for more information.
_________________
Beta Testing Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
carl_mcdade
-


Joined: 25 Jun 2004
Posts: 4

PostPosted: Sat Jun 26, 2004 1:40 pm    Post subject: Reply with quote

There is no problem with the error page itself but it stands in the way of the parse error returned from the perl or php exe. A parse error is automatically returned from the core functions of the CGI and should be written to screen. Abyss does not pick up these and returns a redirect to the error 200 page instead.

Example:

print $variable


Should return a missing ; error to screen because the default for the CGI exe is report all and its intern function should print this to screen.

This is not just a failing in the Abyss Server but all of the smaller personal web servers. To stand out from that crowd Abyss should have this feature in future versions.
Back to top View user's profile Send private message
aprelium-beta
-


Joined: 24 Jun 2004
Posts: 383

PostPosted: Sat Jun 26, 2004 2:42 pm    Post subject: Reply with quote

carl_mcdade,

If your script interpreter (Perl for example) detects an error, this error is logged in the cgi.log file and the browser gets an error 500 page. This is more secure than displaying the error message to the users.
_________________
Beta Testing Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
carl_mcdade
-


Joined: 25 Jun 2004
Posts: 4

PostPosted: Sat Jun 26, 2004 3:17 pm    Post subject: Reply with quote

Hmm, Perl was not a good example because you have to explicitly turn that feature off on the server inorder to get a non 500 page. But in cases of PHP, ASP and Python the script error should be there.

As for showing the error the the visitor or user. This just re-enforces my arguement. The fact that the error is never captured and displayed properly for the developer makes it hard for the developer to write error trapping code that does not stop an application with a single HTML page. The developer can create proper error trapping and give the user a useful reponse.

But that is not the real problem. The main point is that without those default errors reports and warning messages from the interpreter, one may sit for days trying to find

on what line there is an extra }
on what line there is a ; missing
on what line there is an undeclared variable
on what line there is a escape character missing

The error reporting and notices should be configurable via the php.ini file or code. Many webservers do this correctly including omniHTTPD which is very small and fast. The reports should be coming as:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field. Or each number up to get desired error
; reporting level
; E_ALL - All errors and warnings
; E_ERROR - fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
Back to top View user's profile Send private message
aprelium-beta
-


Joined: 24 Jun 2004
Posts: 383

PostPosted: Sat Jun 26, 2004 6:28 pm    Post subject: Reply with quote

carl_mcdade,

No web server will detect errors and debug your scripts by itself. It is up to the interpreter you use to do so. Abyss and Apache act as a gateway between your script interpreter and the browser. It has nothing to do with syntax checks and errors detection.
So it is up to you to configure your script interpreter to display those errors or to put them in the log file.
For example, in PHP you should open php.ini and play with the error reporting settings there.
For example, change the value of error_reporting to
Code:
error_reporting  = E_ALL & ~E_NOTICE; display all errors, warnings and notices

to have PHP report errors to the browser.
You can also set log_errors to on to have it log errors to the cgi.log file.
[/b]
_________________
Beta Testing Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group