cgi downloading instead of executing

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





PostPosted: Mon May 06, 2002 7:09 pm    Post subject: cgi downloading instead of executing Reply with quote

I have searched the forum, and this seems to be a common problem, but I have yet to find a clear answer. There are good explanations for how to install PHP and Perl, and instructions to add the cgi path. In my application, I have a cgi written in straight C.

The executable is hello.exe (lower case)

cgi-bin is listed in the cgi paths under advanced properties

/cgi-bin

I have placed the executable in

G:\Program Files\Abyss Web Server\cgi-bin\

(I have the web server installed on my G drive)

the file name is hello.exe (lower case)

when I access the URL:
http://localhost/cgi-bin/hello.exe

I tries to download instead of executing

What am I doing wrong?
Back to top
chuck
Guest





PostPosted: Mon May 06, 2002 7:16 pm    Post subject: More info Reply with quote

Yes, I added
/
to the cgi path
Back to top
TheLinker
-


Joined: 05 Apr 2002
Posts: 165
Location: Oslo, Norway

PostPosted: Mon May 06, 2002 9:13 pm    Post subject: Re: More info Reply with quote

chuck wrote:
Yes, I added
/
to the cgi path


Whap happends if you try to rename the *.exe to *.cgi ?
Back to top View user's profile Send private message Visit poster's website
chuck
Guest





PostPosted: Mon May 06, 2002 9:36 pm    Post subject: Reply with quote

When I rename hello.exe to hello.cgi, and use the url with .cgi extension, it also tries to download the file.

I also checked the alias settings, and tried moving the cgi to another directory by aliasing /cgi-bin to the real path g:\projects\cgi\
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon May 06, 2002 10:51 pm    Post subject: Reply with quote

chuck wrote:
When I rename hello.exe to hello.cgi, and use the url with .cgi extension, it also tries to download the file.

I also checked the alias settings, and tried moving the cgi to another directory by aliasing /cgi-bin to the real path g:\projects\cgi\

Is CGI processing enabled ? You must not change the extension to cgi. It must be only exe.
What's the compiler used to generate the EXE ?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
chuck
Guest





PostPosted: Mon May 06, 2002 10:58 pm    Post subject: Reply with quote

CGI is enabled. There are no CGI interpreters listed I used GCC Gnu compiler from DJGPP to compile the executable.

http://www.delorie.com/djgpp/
Back to top
chuck
Guest





PostPosted: Mon May 06, 2002 11:01 pm    Post subject: Reply with quote

Here is the source to my CGI:

#include <stdio.h>

int main(int argc,char **argv)
{
printf("Content-type: text/html\n\n");
printf("<html>\n");
printf("hello\n");
printf("</html>\n");
return 0;
}
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon May 06, 2002 11:05 pm    Post subject: Reply with quote

chuck wrote:
CGI is enabled. There are no CGI interpreters listed I used GCC Gnu compiler from DJGPP to compile the executable.

http://www.delorie.com/djgpp/

DJGPP generates 16-bit DOS executables. Abyss Web Server is only able to run 32-bit Win32 console based executables.
Not running 16 bit DOS EXE is a limitation which is not related to us but rather to a lot of unstabilities when running such executables on Windows 95/98/ME. So we removed the feature.
We recommend using another free compiler such as LCC or Borland C++ free compiler to have Win32 executables (or Visual C++ if you have it).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
chuck
Guest





PostPosted: Mon May 06, 2002 11:23 pm    Post subject: Reply with quote

I rebuilt the project under Visual Studio, and it works properly now. Thanks, however, I am suprised, because the DJGPP web site saye the following:

DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS.
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon May 06, 2002 11:33 pm    Post subject: Reply with quote

chuck wrote:
I rebuilt the project under Visual Studio, and it works properly now. Thanks, however, I am suprised, because the DJGPP web site saye the following:

DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS.

Some DJGPP internals: EXEs made with DJGPP are 16 bit DOS EXE which manage to switch to a 32 bit mode only when running. So the Windows operating system need to activate its DOS compatibilty subsystem to run those EXEs (and it is not so stable :wink: .)
_________________
Support 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