in reply to Re: perlbrew configuration and CGI Script
in thread perlbrew configuration and CGI Script

Thank you for your replies!

~/perl5 and all subfolders are all set to my user name and staff mstep:staff

So I have to look into my /etc/apache2/httpd.conf file?

  • Comment on Re^2: perlbrew configuration and CGI Script

Replies are listed 'Best First'.
Re^3: perlbrew configuration and CGI Script
by huck (Prior) on Mar 04, 2017 at 21:51 UTC

    Ah but what does apache run under?

    $ps -ef | grep apa www-data 1785 1780 0 Mar03 ? 00:00:00 /usr/sbin/apache2 -k s +tart ... $ groups www-data www-data : www-data huck
    Its my playground, i just placed it into my group, is yours in staff?

    Edit:, and im assuming the modes are u+rwx g+rx, on the sub/files. if your other mode is --- or --x dir/file-modes could be the problem if www-data(or whatever) is not in staff

      Thank you huck for your reply

      I did some researches after your reply. I did not knew how to look into apache user group. So here it comes:

      First: the apache process on mac is called httpd. I changed your command to:

      $ ps -ef | grep -i httpd 0 845 1 0 10:00AM ?? 0:00.14 /usr/sbin/httpd -D FO +REGROUND 70 857 845 0 10:00AM ?? 0:00.01 /usr/sbin/httpd -D FO +REGROUND 501 865 434 0 10:02AM ttys000 0:00.00 grep -i httpd

      I changed the permissions of all folders and module I wrote for the script from mstep:staff to root:wheel (folders in /usr/libexec/apache2/lib/perl/WebDB)., which is quite cumbersome on MacOS Sierra, because you have to disable the SIP issuing csrutil disable in recovery mode. But still the same problem:

      #!/usr/bin/perl -> working #!/usr/local/bin/perl -> NOT working ls -l /usr/local/bin/perl lrwxr-xr-x 1 mstep admin 55 Feb 24 07:12 /usr/local/bin/perl@ -> /U +sers/mstep/perl5/perlbrew/perls/perl-5.25.10/bin/perl

      I think I will give up to use perlbrew and switch back to the system Perl. The error_log of apache says with the Shebang of perlbrew

      [Sun Mar 05 10:00:35.350898 2017] [cgi:error] [pid 857] [client ::1:49 +249] AH01215: BEGIN failed--compilation aborted at /Library/WebServer +/CGI-Executables/todo04.pl line 28.: /Library/WebServer/CGI-Executabl +es/todo04.pl [Sun Mar 05 10:00:35.350982 2017] [cgi:error] [pid 857] [client ::1:49 +249] End of script output before headers: todo04.pl