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

In reply to Re^4: perlbrew configuration and CGI Script by marek1703
in thread perlbrew configuration and CGI Script by marek1703

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.