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?
Add these lines to your apache2.conf file
<Directory /usr/local/apache2/htdocs/somedir>
Options +ExecCGI
</Directory>
AddHandler cgi-script .cgi .pl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With