Skip to content
Advertisement

Not loading ‘libphp5’ module with CA on apache2.4.51

On Macbook M1Max.
Installed PHP5.6 by ‘shivammathur/php/php@5.6’ via Homebrew.
And set the module info on a configuration file(httpd.conf) of Apache.

LoadModule php5_module /opt/homebrew/opt/php@5.6/lib/httpd/modules/libphp5.so "apache2"

then passed apachectl syntax check that has no error.

$ apachectl configtest
[Fri Jan 14 19:48:05.352957 2022] [so:notice] [pid 5436] AH06662: Allowing module loading process to continue for module at /opt/homebrew/opt/php@5.6/lib/httpd/modules/libphp5.so because module signature matches authority "apache2" specified in LoadModule directive
Syntax OK

BUT, apache still occurred below errors.

[Fri Jan 14 19:50:25.774217 2022] [so:error] [pid 5534] /usr/bin/codesign failed; unable to obtain code signature for module
[Fri Jan 14 19:50:25.774243 2022] [so:error] [pid 5534] AH06663: Unable to find code signature authority on module at /opt/homebrew/opt/php@5.6/lib/httpd/modules/libphp5.so that matches authority name "apache2" configured on LoadModule directive.
httpd: Syntax error on line 190 of /private/etc/apache2/httpd.conf: Code signing error - not loading module at: /opt/homebrew/opt/php@5.6/lib/httpd/modules/libphp5.so

How can fix them?

Advertisement

Answer

Please use httpd package from Homebrew instead of system Apache as that requires code signing.

  • Unload the system Apache
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
  • Make sure httpd is installed using brew
brew install httpd
  • Then you can configure httpd to run PHP using /opt/homebrew/etc/httpd/httpd.conf config file.

  • Once done, restart httpd and it should work.

brew services restart httpd
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement