CGI downloads instead of executes

Problems with the Linux version of XAMPP, questions, comments, and anything related.

CGI downloads instead of executes

Postby tier4 » 10. August 2011 13:28

Hello. I have a VirtualBox'ed Ubuntu set up with xampp I installed just now. My problem is that when I try to run my cgi script, the browser only downloads the file. There is already a
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

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("<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
<form action="/cgi-bin/test.cgi">
<input type=submit value='compute'>

Other possibly useful info:
The permissions of the test.cgi file is -rwxr-xr-x
Posts: 1
Joined: 10. August 2011 13:15

Re: CGI downloads instead of executes

Postby JonB » 11. August 2011 00:02

I 'think' its an ownership and/or permissions issue.

the test.cgi might have to be world-executable. I think it comes down to: who owns the process that launches the executable???

just 'thoughts'

Good Luck
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests