Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-13-2009, 01:27 PM   #1
Registered: Oct 2008
Posts: 36

Rep: Reputation: 15
cgi: exec format error

Hello, I tried to run a binary cgi in the /var/www/archive/cgi directory. The permission is already set to 777 and a simple perl program works well in this directory. But it fails when run this binary cgi. The error in error.log is
(8)Exec format error: exec of '/var/www/archive/cgi/ArchiveDataServer.cgi' failed
Premature end of script headers: ArchiveDataServer.cgi, referer: http://localhost/archive/cgi/

The error in web browser is:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Old 08-13-2009, 11:12 PM   #2
Senior Member
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Are cgi handlers enabled for your file type?

AddHandler cgi-script .cgi
Is the archive/cgi directory covered by an ExecCGI declaration?

<Directory "/var/www/archive/cgi">
    Options ExecCGI

Last edited by neonsignal; 08-13-2009 at 11:15 PM.
Old 08-14-2009, 10:10 AM   #3
Registered: Oct 2008
Posts: 36

Original Poster
Rep: Reputation: 15
Yes. The AddHandler and Options are already added in apache2.conf.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot: cannot execute /bin/sh: Exec format error jnojr Linux - General 8 06-24-2012 01:52 AM
chroot: cannot run command `/bin/bash': Exec format error snakeo2 Linux - Newbie 6 09-28-2010 04:41 AM
Exec format error. binary file not executable. kaz2100 Linux - General 2 08-19-2006 06:26 PM
exec cmd=perl... work but exec cgi doenst crions Slackware 5 12-09-2005 01:17 PM
MDK 9.1 Fatal Error in Stage 1: Exec Format Error Beano Mandriva 5 09-12-2004 04:04 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration