httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <>
Subject Re: 500 internal server error
Date Tue, 12 Feb 2002 09:10:01 GMT
"Alex Blundell (aj)" wrote:
>  Hi, I have set up my server and I thought everything was ok within apache
> until I tried to upload a cgi script.

I presume you mean "execute a cgi script"... "upload" just means copying
it onto the server - did you manage to do this?

> I use newspro and this works fine.

No idea what "newspro" is..

> But I have tried about 4 different image scripts and i allways get an error
> 500 returned.
> and I also get the same with another version of the script
> Internal Server Error
> I have checked my error logs and it says :
> [Tue Feb 12 03:39:10 2002] [error] (2)No such file or directory: exec of
> /home/aj/public_html/cgi-bin/image.cgi failed

This message means that there is no such file as
/home/aj/public_html/cgi-bin/image.cgi, or, the shebang line which
defines the script interpreter is wrong (e.g. #!/usr/bin/perl when it
should be #!/usr/local/bin/perl).

> [Tue Feb 12 03:39:10 2002] [error] [client 213.1.135.xx] Premature end of
> script headers: /home/aj/public_html/cgi-bin/image.cgi
> [Tue Feb 12 03:39:27 2002] [error] (13)Permission denied: exec of
> /home/aj/public_html/cgi-bin/ failed

This means that the script does not have execute permission set ("chmod
+x" to fix), or, this directory is not enabled for CGI (Options
ExecCGI in httpd.conf for this directory to fix).

> [Tue Feb 12 03:39:27 2002] [error] [client 213.1.135.xx] Premature end of
> script headers: /home/aj/public_html/cgi-bin/

To debug further, try executing the scripts on the server from the
commmand-line. They must work flawlessly there before you have any

There are a lot of things to get right before CGIs will work - read the
docs for more details, but a brief list is:

- prog is executable
- directory allows CGI
- prog produces proper CGI header before any other output
- prog has to work form command-line on server
- prog has to work as apache User on server (not same as previous!)


Owen Boyle.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message