Enviado em 22/12/2015 - 13:31h
Como configurar no linux para poder executar um programa em c no navegador.
programa
/*****************************************************************
* C Programming in Linux (c) David Haskins 2008
* hello.c
*
*****************************************************************/
#include <stdio.h>
int main(int argc, char *argv[])
{
int i=0;
printf("Content-type:text/plain\n\n");
printf("Hello, you are still learning C!!\n");
printf("Number of arguments to the main function:%d\n", argc);
for(i=0;i<argc;i++)
{
printf("argument number %d is %s\n", i, argv[i]);
}
return 0;
}
compilei como ./hello e salvei na pasta /usr/lib/cgi-bin
mas quado insiro o endereço //localhost/cgi-bin/hello
não funciona
desde já agradeço a contribuição.
programa
/*****************************************************************
* C Programming in Linux (c) David Haskins 2008
* hello.c
*
*****************************************************************/
#include <stdio.h>
int main(int argc, char *argv[])
{
int i=0;
printf("Content-type:text/plain\n\n");
printf("Hello, you are still learning C!!\n");
printf("Number of arguments to the main function:%d\n", argc);
for(i=0;i<argc;i++)
{
printf("argument number %d is %s\n", i, argv[i]);
}
return 0;
}
compilei como ./hello e salvei na pasta /usr/lib/cgi-bin
mas quado insiro o endereço //localhost/cgi-bin/hello
não funciona
desde já agradeço a contribuição.