Hello,

Whenever I put in a file with .asp extension then I get 500 Internal
Server Error. It works fine with file in demo directory and ended in
.htm extension. Do you have any suggestions? I am using RedHat Secure
Server 6.0

Here is the syntax_error.html out put
Errors Output

Can't call method "SyntaxError" on an undefined value at (eval 11) line
78.
, /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 880

Debug Output

STARTING ASP HANDLER (v0.09) for file
/home/httpd/html/eg/syntax_error.htm
GlobalASA package
Apache::ASP::Compiles::_home_httpd_html_eg___global_asa
ASP object created - Application: ; GlobalASA:
Apache::ASP::GlobalASA=HASH(0x82f5f54); Internal: ; Request:
Apache::ASP::Request=HASH(0x836456c); Response:
Apache::ASP::Response=HASH(0x836f460); Server:
Apache::ASP::Server=HASH(0x83d9b58); Session: ; app_start: 0; basename:
syntax_error.htm; buffering_on: 0; cgi_do_self: 0; command_line: ;
compile_error: ; compile_includes: ; cookie_path: /; debug: 2;
debugs_output: ARRAY(0x8364500); dirname: /home/httpd/html/eg; errors:
0; errors_output: ARRAY(0x837b288); filehandle: ; filename:
/home/httpd/html/eg/syntax_error.htm; filter: 0; global:
/home/httpd/html/eg/.; group_refresh: 120; groups_refresh: 120; id:
NoCache; mtime: 942102130; no_cache: 1; no_headers: 0; no_session: 0;
no_state: 1; pod_comments: 1; r: Apache=SCALAR(0x8319ad0); remote_ip:
10.0.0.1; secure_session: ; session_serialize: ; session_timeout: 1200;
soft_redirect: ; stat_inc: ; state_db: SDBM_File; state_dir:
/home/httpd/html/eg/./.state; state_manager: 10;
inlining include header.inc
compiling - package: NoCache;
Script_OnStart
executing - id: _home_httpd_html_eg___global_asa; routine:
Script_OnStart;
executing - id: NoCache; routine: ;
Debugging - can; take - just: about;  - any; kind - of reference - or
scalar
building cgi headers
sending cgi headers
Can't call method "SyntaxError" on an undefined value at (eval 11) line
78.
, /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 880
Script_OnEnd

ASP to Perl Program

  1: package Apache::ASP::Compiles::NoCache;
  2: no strict;
  3: use vars qw($Application $Session $Response $Server $Request);
  4:
  5: # allow developers to place modules in global directory
  6: use lib qw(/home/httpd/html/eg/.);
  7:
  8: # aliases here
  9: sub exit { $main::Response->End(); }
 10:
 11: # handler gets called from ASP perl handler to run code
 12: sub handler {
 13:   my($self, $routine) = @_;
 14:
 15:   if($routine && ($routine ne "handler")) {
 16:     return &$routine;
 17:   }
 18:   $self = $routine = undef;
 19:   @_ = ();
 20:
 21: #######################################################
 22: ## Your ASP script has been parsed and inserted here !!
 23: #######################################################
 24:
 25:
 26: ## CODE BEGIN ##
 27:    $Response->{Buffer} = 0;
 28: ## END ##
 29:
 30: ## CODE BEGIN ##
 31:    use DemoASP;
 32:    $demo = &DemoASP::new;
 33: ## END ##
 34:
 35: $main::Response->Write(
 36: '<html>
 37: <head><title>'.($demo->{title}).'</title></head>
 38: <body bgcolor='.($_[0] || $demo->{bgcolor}).'>
 39:
 40: We are creating a perl syntax error... this should demonstrate
 41: how error handling is done.  Please check the error log file if
 42: you are interested in the output there.
 43: <p>
 44: You can turn this error messaging off by setting the Debug variable

 45: in the ASP config to 1 or 0.
 46: <p>
 47: Also here is an example of how you can use debugging, an API
 48: extension $Response->Debug(@args), in your script.  The debug
 49: output will show up below, and in your error logs.  This user
 50: style debugging is turned off with the same Debug setting set to 0.

 51: <p>
 52: '
 53: );
 54:
 55: ## CODE BEGIN ##
 56:    $Response->Debug(
 57:    "Debugging",
 58:    ['can', 'take'],
 59:    {'just'=>'about'},
 60:    sub { ['any', 'kind']},
 61:    \"of reference",
 62:    "or scalar"
 63:    );
 64: ## END ##
 65:
 66: $main::Response->Write(
 67: '<a
href="source.asp?file='.($Request->ServerVariables("SCRIPT_NAME")).'">
 68: view this file\'s source
 69: </a>
 70: '
 71: );
 72:
 73: ## CODE BEGIN ##
 74:    # flush output that we have written so far, for prettier error
 75:    $Response->Flush();
 76:
 77:    # create a run-time syntax error
 78:    $Object->SyntaxError();
 79: ## END ##
 80:
 81: $main::Response->Write(
 82: ''
 83: );
 84:
 85:
 86: #######################################################
 87: ## End script insert
 88: #######################################################
 89:
 90:   $main::Response->End();
 91: }
 92: 1;

This is my Error log file output:
[root@www .state]# tail /etc/httpd/logs/error_log
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] compiling -
package: NoC
ache;
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] Script_OnStart
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] executing - id:
_home_ht
tpd_html_eg___global_asa; routine: Script_OnStart;
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] executing - id:
NoCache;
 routine: ;
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] Debugging - can;
take -
just: about;  - any; kind - of reference - or scalar
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] building cgi
headers
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] sending cgi
headers
[Wed Nov 10 10:32:06 1999] [error] [asp] [error] Can't call method
"SyntaxError"
 on an undefined value at (eval 15) line 78. <--> ,
/usr/lib/perl5/site_perl/5.0
05/Apache/ASP.pm line 880
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] Script_OnEnd
[Wed Nov 10 10:32:06 1999] [error] [asp] [debug] [5304] destroying -
asp: Apache
::ASP=HASH(0x8400204);
--
Hung Q. Nguyen
Practical Solutions, Inc.
404-762-5600 ext 103

Reply via email to