I cannot get perl cgi scripts running on my apache2. Safari displays the text of the script, instead of the intended output. Apache is running, and can run php scripts. Perl programs run from the Terminal. I am using the default installs of perl and apache2 on Catalina running on a 2019 Air.

  1. I uncommented the perl line in the AddHandler section of http.conf
  2. I added the .pl extension in AddHandler cgi-script
  3. I shtml to AddType
  4. I changed permissions on the file to:

chmod a+x /Library/WebServer/CGI-Executables/hello.pl,

as recommended in another AskDifferent question on the same problem 5. I did apachectl -k restart

Nothing has worked. Here's my /etc/apache2/users/jrw file:

<Directory "/Users/jrw/Sites/">
AddLanguage en .en
AddHandler perl-script .pl
PerlHandler ModPerl::Registry
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride None
Require host localhost

The scripts are in /Library/WebServer/CGI-Executables. Do I need a symlink directing CGI-Executables to "cgi-bin"? That doesn't seem to be necessary, because the url "localhost/cgi-bin" finds the script. It displays the text in the browser. This may be irrelevant, but perl worked for me in Mojave. I upgraded Mojave to Catalina on my previous Air, which developed a glitch in the power controller. My present Air had the drive doubled from the old one. I have not tried to run perl since upgrading from Mojave to Catalina. Thank you for any and all guidance.

You must log in to answer this question.

Browse other questions tagged .