Does this help?
Running scripts outside of the cgi-bin
This article describes how to execute scripts outside of your cgi-bin
You will be able to execute CGI scripts outside of your cgi-bin.
Enabling this in a web-accessible directory is slightly more insecure
than limiting script execution to the cgi-bin, because if a malicious
script is ever uploaded to your server, it will be more easily able to
Before you start, you'll need:
- FTP login credentials and a plain text editor or SSH enabled and vi knowledge.
Add the following lines to your
AddHandler cgi-script .cgi .pl
Then, upload the
.htaccess file to the directory in which you want
to enable CGI script execution, via FTP. For more information on
creating and uploading
.htaccess files, please see: Using .htaccess
You can add any file extension to the AddHandler line in your
.htaccess file. The example is for CGI and Perl scripts.
If you are using this directive in your existing cgi-bin directory,
the above line alone will also work.
Source: Running scripts outside of the cgi-bin