tags:

views:

39

answers:

2

I'm trying simple example -

#include <stdio.h>

int main(void)
 {
 printf("Content-type: text/html\n\n");
 printf("<html><title>Hello</title><body>\n");
 printf("Goodbye Cruel World\n");
 printf("</body></html>");
 return 1;
 }

compiled and moved to apache docroot - but when i click on url - it comes as a popup and asks where to download/save this binary file? how to fix this?

+3  A: 

Unfortunately, unless you already have other CGI scripts running in the same place, this is harder than just plopping a file somewhere - some stuff has to be configured in the web server to make it possible: apache settings, the .htaccess file, permissions, and so on.

Make sure you read the Apache Tutorial on CGI to be up to date with what needs to be configured.

Eli Bendersky
i'll try these links and update this post.
lakshmipathi
+2  A: 

Check the similar one here but its c - cgi

Method is same

JapanPro
i'll try these links and update this post.
lakshmipathi