Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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

They use different approaches to execute scripts.

This document 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

Your Answer


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.