0

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?

1 Answer 1

0

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.

3
  • 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, 2012 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, 2012 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, 2012 at 6:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .