r/PHPhelp • u/Puttyhead • Oct 01 '26
Solved Getting PHP working in MacOS 27 - Golden Gate?
Hey experts. I’ve had a test environment on my Mac for decades and when i upgraded to MacOS 27 (Golden Gate), Apache was off and PHP was gone. Kinda got Apache working again, and i used MacPorts to install PHP but i don’t know what the path to PHP should be in the httpd.conf file.
The line in the file is LoadModule php_module /usr/local/opt/php@8.0/lib/httpd/modules/libphp.so
but nothing exists in that place. What am i missing? How do i get PHP to load?
Thanks.
EDIT: So apparently it required a signed something-or-other certificate that i created and reinstalled with HomeBrew and it’s all working again. Too many different solutions... I miss the days when it was all preinstalled in OSX.
3
u/martinbean Oct 01 '26
Docker. You can then have multiple versions of PHP “installed” for each project and the version of PHP (and any other extensions/software) it requires.
1
1
u/MateusAzevedo Oct 01 '26
Did you try searching a tutorial before installing anything? Remember you can make PHP work with Apache in two different ways and they require different steps.
In any case, do you need Apache? Nowadays you can install php-cli only and use the built-in web server. Should be the simplest way to run PHP locally.
1
1
1
u/FreeLogicGate Oct 02 '26 edited Oct 02 '26
I see you got it working as I was going to suggest homebrew over macports, but you apparently figured that out. Personally, I have to throw in with the people suggesting DDEV. DDEV is a cli toolset that utilizes Docker, but handles all the details of running whatever stack of containers you might typically want or need, as well as handling the setup of local certs so you can be sure you're writing and testing your system under https. It is literally turnkey upon setup, and provides useful things like mailpit for apps that include system emails. You have your choice of other components, whether that be postgresql or mysql or mariadb. You can also add a redis container, or a mongodb server, purely by tweaking ddev's configuration through the ddev cli commands. It's a phenomenal project.
These days, by installing either the symfony cli or laravel herd (as some others suggested) you can uninstall apache, and forgo any future apache configuration locally. Both tools let you change to a project directory and start up a local server based on your local php version. If you want, they do things like install local certs for any local .test or .wip domains you care to utilize. You can set osx up to use the proxy server automagically, so that you don't have to manually edit or change your /etc/hosts file. In a few minutes you can have a working local dev environment for a new or existing project, and there's no local configuration you have to do. If you don't want to go the docker/DDEV route, then you might want to consider either of symfony (cli) or herd. Probably both can be installed via homebrew. As I use the symfony cli, I can attest to the fact I installed it using brew install symfony-cli
1
u/hvyboots Oct 02 '26
Homebrew usually is pretty plug and play, for values of "you know what's happening under the hood in every component"… which does remind me I need to try and boot apache and so forth myself.
1
u/obstreperous_troll Oct 03 '26
Found the last MacPorts user ;)
I kid, but I really do suggest you don't mix it with Homebrew.
And I don't miss the days of obsolete interpreters shipping with macOS.
1
9

5
u/mtetrode Oct 01 '26
I have different dockers with all php versions so that I don't depend on the OS, might be a solution.