cancel
Showing results for 
Search instead for 
Did you mean: 

.htaccess options and perl don't mix

marku
Grafter
Posts: 28
Registered: ‎12-03-2010

.htaccess options and perl don't mix

Hi All.
I am testing out the use of .htaccess placed in a specific directory, cgi-bin (permissions 0710). Its contents are very simple
Options +ExecCGI
AddHandler cgi-script pl cgi
It's uploaded as ascii with default permissions of 0640.
When I then try to run a perl script in that directory I receive the 'Server Error  500'.    If I remove the .htaccess file altogether (and there are no others in my area), all the .pl scripts work fine.
Would anyone know why this is ?

5 REPLIES 5
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: .htaccess options and perl don't mix

We don't allow the AddHandler directive on the new platform, so that would be the cause of the 500 error.
However, due to the way suEXEC works, you can have perl scripts in any directory in your CGI space and it will work.
marku
Grafter
Posts: 28
Registered: ‎12-03-2010

Re: .htaccess options and perl don't mix

Hi Ben,
Does this mean that any perl script must end in and only end in .pl ?  It's just I have some perl scripts without extensions and I was seeing if the .htaccess file could force these files to be processed by the Perl interpreter.
thanks,  Mark
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: .htaccess options and perl don't mix

At the moment it will only work for .php, .pl or .cgi. Naming perl files .php would be a bit odd, but should work, .pl or .cgi makes more sense. You could always use a rewrite once the file has been renamed so you don't have to change all your links.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: .htaccess options and perl don't mix

Nah, .php will go to the php interpreter, but .cgi would work with a shebang line. Ben's suggestion of a rewrite's best, if you really don't want extensions.
Gabe
Ben_Brown
Grafter
Posts: 2,839
Registered: ‎13-06-2007

Re: .htaccess options and perl don't mix

Oh yeah, I forgot about the binfmt stuff, that forces the interpreter for .php files to be php.