ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/" line in the httpd.conf file by default, so I'm left scratching my head wondering why the file is only being downloaded.
Using htaccess files doesn't seem to work either.
I've also tried this and it doesn't work too:
- Code: Select all
<Directory /opt/lampp/cgi-bin/>
Options +ExecCGI
</Directory>
This is the C file I compile into the test.cgi file:
- Code: Select all
#include <stdio.h>
#include <stdlib.h>
int main(void){
printf("Content-type:text/html\n\n");
printf("<html><body>hello world!</body></html>");
return 0;
}
This is the html file I'm using. It is named "mp.html" and is in the folder /opt/lampp/htdocs. I access it through "localhost/mp.html" in the web browser.
- Code: Select all
<html><body>
<form action="/cgi-bin/test.cgi">
<input type=submit value='compute'>
</form>
</body></html>
Other possibly useful info:
The permissions of the test.cgi file is -rwxr-xr-x