cancel
Showing results for 
Search instead for 
Did you mean: 

Perl Script not Working Since Migration

spidermonkey
Hooked
Posts: 9
Registered: ‎28-09-2010

Re: Perl Script not Working Since Migration

Am also having trouble with cgi-bin.
Tried various settings but no matter where I put a 'hello word' cgi file I'm getting 'Internal Server Error' when I call it.
For now I want to use /public/cgi-bin/
What do I need to do to the root .htaccess file to allow this?
My root .htaccess currently has the following:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^cgi-bin(/.*|)$ CGI-BIN$1 [L,NC]

Also, is the shebang for perl still #!/usr/bin/perl ?
Thanks.

spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Perl Script not Working Since Migration

The root /.htaccess content is correct, it redirects to /public/CGI-BIN which should be a link to /public/cgi-bin where your CGIs go. File Manager doesn't show links but an FTP program should do.
Your CGIs need to be executable, did you set their file permissions (chmod) to 700?
That shebang for Perl is correct.
David
David
spidermonkey
Hooked
Posts: 9
Registered: ‎28-09-2010

Re: Perl Script not Working Since Migration

OK so with that .htaccess in the root and then calling the script, it is just written to the screen rather than executed.
If I add AddHandler cgi-script .cgi .pl to the .htaccess, calling the script gives the Internal Server Error.
Tried 777 and 700 permissions.

spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Perl Script not Working Since Migration

Try removing the AddHandler directive from the root /.htaccess and put it in /public/.htaccess.
David
David
spidermonkey
Hooked
Posts: 9
Registered: ‎28-09-2010

Re: Perl Script not Working Since Migration

OK thanks -  I have my 'hello world' script running from the \public\cgi-bin\ folder now.
Now need to work on the real scripts!