在 Macbook M1Max 上。
'shivammathur/php/[email protected]' 通過 Homebrew 安裝了 PHP5.6。
并在 Apache 的組態檔(httpd.conf)中設定模塊資訊。
LoadModule php5_module /opt/homebrew/opt/php@5.6/lib/httpd/modules/libphp5.so "apache2"
然后通過沒有錯誤的 apachectl 語法檢查。
$ 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
但是,apache 仍然出現以下錯誤。
[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
如何修復它們?
uj5u.com熱心網友回復:
請使用httpd包Homebrew而不是系統 Apache,因為這需要代碼簽名。
- 卸載系統Apache
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
- 確保
httpd使用 brew 安裝
brew install httpd
/opt/homebrew/etc/httpd/httpd.conf然后您可以使用組態檔配置 httpd 以運行 PHP 。完成后,重新啟動
httpd,它應該可以作業。
brew services restart httpd
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/413780.html
標籤:
