RobertJ has asked for the wisdom of the Perl Monks concerning the following question:

Going Crazy.

Have got my Apache server running under Sierra; however, none of my cgi scripts works. In desperation I wrote a simple Hello World script but even that doesn't work; the script shows up as text in the browser instead of executing. Here is the script.

#!/usr/bin/perl # hello.pl -- a simple perl script! print "Content-type: text/html\n\n"; print "Hello, world!\n";

Permissions on the directory/script are correct rwxr-xr-x with "me" as owner and group as "staff".

This worked using El Capitan. Hopefully there is someone out there on a Mac with a solution/suggestion.

Will be off line for the next 15 hours; not ignoring any help. Thanks.

Replies are listed 'Best First'.
Re: perl cgi on Sierra (configure apache)
by Anonymous Monk on Nov 20, 2016 at 23:13 UTC

      Thanks for reply but I know all of that. Apache working including php. However, will not execute Perl cgi scripts.

      It all worked in El Capitan.

        Apple frequently changes parts of dev stuff in releases and you have to install Xcode to have a bunch of it at all. If it's serving text for the CGI and the file is executable then it can only be a missing configuration issue where CGI is not enabled for that dir.

        Thanks for reply but I know all of that. Apache working including php. However, will not execute Perl cgi scripts. It all worked in El Capitan.

        Hi,

        Are you sure? If so, what is the solution (what was the problem)?

        There is only one reason apache would treat "hello.pl" as a text file,

        its because it doesn't know to treat "hello.pl" differently,

        because it has not been configured to treat "hello.pl" differently

        Don't rely on default vendor apache configurations, vendors make changes . Maintain your own configuration file, avoid surprises.