Regarding the AH00558: httpd error message: Could not reliably determine the server's fully qualified domain name...
Claude said:
That ServerName message is just a harmless warning, not an error.
Let's clean it up anyway since it's a one-line fix, then get Apache running.
Reminder:All commands in zsh. Always use code with caution.
#1. (Optional but recommended) Suppress the ServerName warning:
grep -n "^#ServerName|ServerName" /usr/local/etc/httpd/httpd.conf
#2.Find the #ServerName www.example.com:8080 line and uncomment/set it:
sed -i '' 's/#ServerName www.example.com:80/ServerName localhost:8080/' /usr/local/etc/httpd/httpd.conf
(Adjust the port in that command to match whatever port your httpd.conf actually has — check the grep output first since Homebrew httpd often defaults to port 8080, not 80.)
#3. Restart Apache
brew services restart httpd
#4. Confirm it's actually running"
brew services list | grep httpd
ps aux | grep httpd | grep -v grep
#5. Find your DocumentRoot and drop a test file there:
grep -m1 "DocumentRoot \"" /usr/local/etc/httpd/httpd.conf
#6. Take that path and run (substituting it in):
echo '<?php phpinfo(); ?>' | sudo tee /usr/local/var/www/phpinfo.php
(Use sudo tee since that directory is often root-owned; adjust the path to match what step 4's grep returned.)
#7. Check what port Apache is actually listening on
grep -n "Listen" /usr/local/etc/httpd/httpd.conf
(Homebrew's httpd frequently defaults to Listen 8080 rather than 80. So your test URL is likely:
http://localhost:8080/phpinfo.php)