Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a .cgi file in Ubuntu

I am running Apache/PHP under Ubuntu

When I run the .cgi file, by going at http://localhost/mycgi.cgi, the browser will display the code instead of running it.

How do I make the browser execute the CGI file instead of showing its contents?

like image 792
X10nD Avatar asked Feb 22 '11 19:02

X10nD


1 Answers

Add these lines to your apache2.conf file

<Directory /usr/local/apache2/htdocs/somedir>
    Options +ExecCGI
</Directory>

AddHandler cgi-script .cgi .pl
like image 51
Saariko Avatar answered Oct 22 '22 21:10

Saariko