Disclosure: Hosting Canada is community-supported. We may earn a commission when you make a purchase through one of our links. Learn more.

Enable CGI outside the cgi-bin

In case you are not allowed by your web server to run CGI scripts outside the directory ‘cgi-bin’, CGI can be enabled. Contact your hosting service provider and system administrator before you do so.

For enabling CGI, make an .htaccess file by following the guidance and main instructions that include the text below.

AddHandler cgi-script .cgi
Options +ExecCGI

Codes above will instruct Apache Web Server for firstly allowing the process ‘.cgi’ files as CGI scripts also it will secondly get CGI enabled in directory.