Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mac57mac57

macrumors 6502
Original poster
Aug 2, 2024
351
200
Myrtle Beach, SC
After much frustration and almost literally hair pulling, I have to admit that Sonoma has beaten me. I cannot get either HTTPD or PHP running under Sonoma. This is the first release ever of macOS/Mac OS X that I have not been able to get this set enabled on since I started using Macs back in 2006. Quite frustrating indeed.

I used MacPorts to install both APACHE and PHP (got PHP82). apachectl is located in /opt/local/sbin, as is httpd. httpd.conf is at /opt/local/etc/apache2. Command line PHP82 is at /opt/local/bin/php82 and apache's mod_php82.so is at /opt/local/lib/apache2/modules.

What I am not sure of is where all of this gets energized during startup. Can anyone point me in that direction?

Right now, when I try to start it manually, I get:

httpd Output.jpg


Any and all pointers most appreciated!
 
I usually mess up my Mac with multiple installations, so been there.
What I would do first to check if you can run Apache is to change the port to something else, like 8080 first. If that starts, there's just some other version probably running.
In case you are not familiar with this, just find the httpd.conf file (do not use macPorts so not sure where it is located), and change the line that says Listen 80 to Listen 8080, and try again.
Id that works, you can run your server in that port while you figure out what else is running.
 
I've only once - years ago - tried modifying the built in support for PHP, MySQL and Apache on macOS (technically OS X back then). And that's the only time I eff'ed up my Mac so badly that I needed to do a full reinstall. (I did have backup so it wasn't a very big deal, except the time spent.)

Since that I've never touched that part om macOS and just used MAMP instead. Much less headache, and easier to nuke and reinstall when it acts up.
 
Can anyone point me to where in the initialization process Apache is started up? There must be an init file somewhere that does this. Thanks!
 
Can anyone point me to where in the initialization process Apache is started up? There must be an init file somewhere that does this. Thanks!
Usually such things are started/stopped by MacOS's Launchd system which is - as they say - beyond the scope of this post.

I think in MacPorts you are supposed to use "sudo port load apache2"/"sudo port unload apache2" commands - which communicate with "launchd" - to enable/disable Apache on startup.
 
Yes, I am ACUTELY aware that some of this is already there. I now have TWO versions of just about everything related to web serving.

... and I am going for THREE! MAMP says it is the free one-stop-shop that will happily install alongside other HTTP stacks. I will try a few more things to get the current stuff going, but if that isn't successful, I'll be giving MAMP a try. Thanks @Mitthrawnuruodo for the MAMP pointer.

This is related to another active thread I have about upgrading to Sonoma. If I can't get local web serving going on Sonoma, I can't update my Mac Studio to Sonoma. I do a LOT of web development and thus the ability to run and test the results locally is critical.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.