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 have NGINX working happily with PHP FPM all tickety-boo.

I am trying to add some Perl pages. I have this in my default site config;

    location ~ \.pl$ {
            gzip off;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www/$fastcgi_script_name;

Browsing to perl pages (example below) in my browser just displays the source code. It's like either the code isn't being passed to the FPM or its not executing it and just passing it back.

I don't know what to do here; I'm not sure how to troubleshoot this. Nothing in NGINX error.log or php5-fpm.log.;


print "Content-type:text/html\n\n";
print <<EndOfHTML;
<html><head><title>Perl Environment Variables</title></head>
<h1>Perl Environment Variables</h1>

foreach $key (sort(keys %ENV)) {
    print "$key = $ENV{$key}<br>\n";

print "</body></html>";
share|improve this question
up vote 0 down vote accepted

Why would this work? PHP-FPM can only process PHP, duh!

However I was hoping that I would pass Perl scripts to the FPM and it would pass them over to perl. I found this page (link below) which answered my question and clears things up nicely.

Why pass a Perl script onto FPM, to then pass it onto Perl, when you can pass it straight to Perl your self with a wrapper! :D

share|improve this answer

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.