sudo apachectl configtest prints this:
/usr/sbin/apachectl: line 92: 78131 Killed: 9 $HTTPD -t
Why?? I tried to restart it several times. If PHP7 module is not loaded, everything works fine, but otherwise it prints this crap.
Moreover, the exact same PHP version (PHP 7.2) worked fine just yesterday. The mac has been recently updated though, this is Catalina 10.15.7, running Apache 2 (system default).
Maybe it’s the update? How can use PHP7 now? Also tried to upgrade to PHP 7.3, but the result is the same..
Pleas help!!
EDIT:
I tested with PHP 7.4 as well, same..
All PHP versions have been installed via homebrew, so they should be fine.
Don’t know what’s going on…
2
Answers
When I make
sudo apachectl -k restart
, I have the same errorI don’t have the error when I comment
LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
and uncommentLoadModule php7_module libexec/apache2/libphp7.so
.I mean I can use php preinstalled with Cantalina but I can’t use php installed by homebrew.
Found the solution!
The actual problem is MAC’s default
apachectl
which keeps raising issues on each MAC update. So need to unload it and load thehomebrew
httpd
.These are the steps:
httpd.conf
and then restart apache usingsudo apachectl -k restart
(this is necessary because if you dont do that the process will be detached from
launchctl
and would still be running, giving you the errororg.apache.httpd.plist could not find specified service
on the next steps)Now configure your new apache instance having the conf file on this location:
/usr/local/etc/httpd/httpd.conf
.When done, just restart