4

Big Sur Macbook — I installed PHP v7.4 using Homebrew, and Apache gave an error message that PHP was not signed. So I followed the steps in this article explaining how to create a certificate authority and code signing certificate in Keychain Access. It worked once, but now I keep getting this error:

[Mon Oct 25 23:37:21.877634 2021] [so:error] [pid 3007] /usr/bin/codesign failed; unable to obtain code signature for module
[Mon Oct 25 23:37:21.877668 2021] [so:warn] [pid 3007] AH06663: Unable to find code signature authority on module at /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so that matches authority name "My Name" configured on LoadModule directive. Proceeding with loading process, but this will be an error condition in a future version of macOS.
Failed loading /usr/local/opt/php@7.4/lib/php/20190902/opcache.so:  dlopen(/usr/local/opt/php@7.4/lib/php/20190902/opcache.so, 9): no suitable image found.  Did find:
    /usr/local/opt/php@7.4/lib/php/20190902/opcache.so: code signature in (/usr/local/opt/php@7.4/lib/php/20190902/opcache.so) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/opt/php@7.4/lib/php/20190902/opcache.so: stat() failed with errno=22
[Mon Oct 25 23:37:21.925733 2021] [mpm_prefork:notice] [pid 3007] AH00163: Apache/2.4.48 (Unix) PHP/7.4.25 configured -- resuming normal operations
[Mon Oct 25 23:37:21.925784 2021] [core:notice] [pid 3007] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Oct 25 23:45:01.160927 2021] [mpm_prefork:notice] [pid 3007] AH00169: caught SIGTERM, shutting down

Also, VS Code has started to demand all of my CPU power, but only when I'm looking at the root folder. If I start at the /etc or /var folder it's fine. What's going on? How can I troubleshoot and fix this?

chillywilly
  • 405
  • 3
  • 11

1 Answers1

0

You may need to codesign again like so:

codesign -s "My Name" --keychain ~/Library/Keychains/login.keychain-db /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so

And you may have to trust your own previous created "My Name" certificate again.

Sounds like an "after update" issue.

Please also refer to this answer i recently made around the same topic.

André Kelling
  • 1,575
  • 16
  • 23
  • Thanks for your response! I'm not having the problem now. I must have fixed it a while after posting this. I would have posted my fix had I remembered that I asked this question. Maybe I did codesign again. Unfortunately, I'm not sure so I can't mark this as the answer. Really appreciate your input though. – chillywilly Feb 02 '22 at 04:13
  • 1
    The problem has returned and unfortunately doing codesign again didn't help. Terminal responded with ```/usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so: is already signed```. I also tried setting the certificate to "Always Trust." I'm still getting the error message, but without the SIGTERM crash. Unfortunately, some of my websites are not loading properly. I'm getting ```net::ERR_EMPTY_RESPONSE``` in DevTools for things like CSS files and images that are right there. – chillywilly Mar 05 '22 at 07:47
  • had new problems after a recent macOs update, too. now i did switched to homebrew setup for all my httpd, apache, php setup. which was horrible.... this guide was quite helpful: https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions for me. as there are a lot of trouble shoot infos. – André Kelling Mar 06 '22 at 10:51
  • Thanks for your comment. I'm using Big Sur on this 2018 Macbook Pro, but perhaps I should update it to Monterey and try this Homebrew version of Apache. Would you recommend it? I'm a bit nervous about the OS update and what might break. – chillywilly Mar 08 '22 at 04:30
  • 1
    when `... libphp7.so is already signed` use `codesign` with the `--force` flag – deevroman Jul 31 '23 at 22:59