Fixing broken homebrew-installed httpd on macOS
2022-01-07 14:12:03 +0100 +0100I use httpd from Homebrew (brew install httpd) as the web server for my local MediaWiki development instance. Mostly that works just fine, and I’ve documented how I’ve set it up in another post here.
Yesterday httpd broke after a brew upgrade and I had trouble figuring out why.
brew services list
Name Status User File
black started kostajh ~/Library/LaunchAgents/homebrew.mxcl.black.plist
dbus none
emacs-plus@27 none
httpd error 6 kostajh ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mariadb none
memcached started kostajh ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist
php none
php@7.4 started kostajh ~/Library/LaunchAgents/homebrew.mxcl.php@7.4.plist
redis started kostajh ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
selenium-server none
Looking at the error.log wasn’t helpful either:
cat /opt/homebrew/var/log/httpd/error_log
[Thu Jan 06 11:41:59.585519 2022] [core:notice] [pid 3003] AH00052: child pid 3393 exit signal Segmentation fault (11)
[Thu Jan 06 11:41:59.587071 2022] [mpm_prefork:notice] [pid 3003] AH00169: caught SIGTERM, shutting down
Eventually I stumbled across a clue to run httpd in foreground mode:
httpd -DFOREGROUND
dyld[69073]: Symbol not found: _apr_bucket_file_set_buf_size
Referenced from: /opt/homebrew/Cellar/httpd/2.4.52/bin/httpd
Expected in: /usr/lib/libaprutil-1.0.dylib
[1] 69073 abort httpd -DFOREGROUND
Aha. That led me to this StackOverflow post where the solution was as simple as brew reinstall apr-util.