cgi with c

Status
Not open for further replies.

Jealousy

Solid State Member
Messages
10
i need your help with the apache server configurations to enable it run the exec. files in the cgi-bin
im using windows xp,i try to run the program by localhost://cgi-bin/examp1.exe but when i try this i see an error page(internal error) and when i write localhost://cgi-bin i see the error page that says i have no permission to see the content of that directory,i think the reason why i cant run the program examp1 is about the permissions,how can i correct that?
 
hi, thanks for the replay,,,

firstly,not c++ i want to use c,
in fact there is no special reason for me to use c for cgi..
in general i use php for server side..but my love with c:) made me to try this.However,i couldnt run even a "ello world" program:(:(:(
i need help for server configurations..

[why to use c? the book i study says that using C provides an efficiency and extreme speed,besides there are some algorithms that we can not write with script languages such as php and perl.]
 
I would suspect that your program does not output the proper information. It needs to provide a valid content-type header. If you want to output "Hello world" to the browser, you would need actualy send this from your program.

Code:
Content-type: text/plain

Hello world
 
again thanks for the reply,,,

but--> the code i try to run doesnt belong to me,i wrote it from the book (yes, it sends content-type: text/html\n\n to the server)
[cgi internet prog with c and c++,Mark Felton] the problem here is the server configurations..I heard about scriptAlias..for the Apache server but actually i dont know how to configure it..
 
again thanks for your reply,,,

,i used to compile my codes with turbo c but yesterday i used devcpp i wrote the code below:

#include<stdio.h>

main()
{

printf("content-type: text/html\n\n");
printf("<html>
<head>
<title>hi,this is my first cgi program</title>
</head>
<body>
Hello internet world!!!
</body>
</html>
");

}

this worked,,after compiling i placed it in the cgi-bin dir.
i run it with localhost://cgi-bin/hi
but i dont know what did i do to correct it,
when using turbo c i wrote the same code..
do you think that turbo c caused the problem?
 
Status
Not open for further replies.
Back
Top Bottom