On previous versions of MacOS, I was able to run perl scripts from a local Apache server that called ActivePerl without problem. With MacOS Sonoma, the same script now generates an “Internal Server Error”,
AH01215: (8)Exec format error, exec of ‘/Users//Sites/index.cgi’ failed
If I replace
#!/Users/<short user name>/Library/Caches/activestate/bin/perl
with the default system perl, it again works:
#!/usr/bin/perl
Example script:
#!/usr/bin/perl
use CGI;
my $cgi = CGI->new;
print $cgi->header( -type => 'text/plain' );
print $ENV{SERVER_SOFTWARE};
when working, returns: Apache/2.4.58 (Unix)
Installation details:
MacOS Sonoma 14.5 (23F79)
/Users/short_user_name/Library/Caches/activestate/bin/perl -v
perl 5 (v5.36.3) provided by ActiveState
sudo apachectl -v
Server version: Apache/2.4.58 (Unix)
I have tried several fixes including the following:
Apache gives Access denied on macOS Catalina
to give system wide access to both /usr/sbin/httpd
and /Users/short_user_name/Library/Caches/activestate/bin/perl
which did not help.
I would really like to get this to work with ActivePerl since I do not want to add modules to the system perl. Any ideas on how to get this to work?