skip to Main Content

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


  1. When I make sudo apachectl -k restart, I have the same error

    /usr/sbin/apachectl: line 92: 16415 Killed: 9               $HTTPD "$@"
    

    I don’t have the error when I comment LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so and uncomment LoadModule php7_module libexec/apache2/libphp7.so.

    I mean I can use php preinstalled with Cantalina but I can’t use php installed by homebrew.

    Login or Signup to reply.
  2. 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 the homebrew httpd.

    These are the steps:

    1. Comment php module in httpd.conf and then restart apache using sudo 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 error org.apache.httpd.plist could not find specified service on the next steps)

    1. Now stop apache and unload it by using these commands:
    sudo apachectl stop
    sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
    
    1. Now use these commands to install apache from homebrew and make it load as service:
    brew install httpd
    sudo brew services start httpd
    
    1. Now configure your new apache instance having the conf file on this location:
      /usr/local/etc/httpd/httpd.conf.

    2. When done, just restart

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search