Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've recently been using PHP via mod_php, and I assumed that getting mod_perl running properly was going to require a similar setup:

AddType application/x-httpd-php .php

unfortunately this does nothing with mod_perl using:

AddType application/x-httpd-perl .pl

the entire script is simply sent out with a

Content-Type: application/x-httpd-perl

header.

Why doesn't mod_perl execute scripts flagged as application/x-httpd-perl as mod_php does with scripts flagged as application/x-httpd-php?

share|improve this question
add comment

1 Answer

They use different approaches to execute scripts.

This document http://perl.apache.org/docs/2.0/user/intro/start_fast.html describes how to install mod_perl handler for scripts in some directory. The "Registry Scripts" section is exactly what you need.

share|improve this answer
    
Um, why is there Options +ExecCGI? I don't want to enable CGI for every single page on the server; that's part of the reason I'm not using CGI. Also, my question is why can't I just set application/x-httpd-perl and have every .pl file outside of /cgi-bin run. –  Hawken Aug 2 '12 at 4:49
    
Again, you should consider that the inner logic of mod_perl and mod_php is different, you may look at differencies in execution of php and perl scripts in the CGI mode, for example. You don't have to enable CGI for all the pages and locations, but only for the location with your scripts which you want to use with mod_perl. –  Denis Aug 2 '12 at 5:06
    
The problem is I want to be able to use Perl everywhere without turning on CGI. Do you know why mod_perl needs ExecCGI? Is there some kind of workaround to having CGI on for the whole server just for mod_perl? –  Hawken Aug 2 '12 at 6:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.