Install php 8.0 in MacOS Sierra with Macports
Yes, you read it right. I live in the past, with old hardware, with legacy operating system. There is homebrew that previously still works in php 7.4 in early releases, but now no longer works. There is an alternative like a one click install app like MAMP PRO but didn’t support php 8.0 yet. XAMPP ? not really extension installable user friendly (as far as I tried)!
I don’t want to lost hope, I give a Macports a try, and it works while it not documented in the wiki yet. If you are using MacOS Sierra and want to try, you can do the following steps:
1. First, you need to have Macports installed first, that we can read in the documentation.
2. Install php 8.0
sudo port install php80
You will get the following note in the end of installation process:
To customize php80, copy /opt/local/etc/php80/php.ini-development (if this is a development server) or /opt/local/etc/php80/php.ini-production (if this is a production server) to /opt/local/etc/php80/php.ini and then make changes.
You can follow that if you want to changes the PHP configuration.
3. Install common extensions
For example, you will need intl
and mbstring
extension, you can run:
sudo port install php80-intl sudo port install php80-mbstring
You can search already available extensions in the search page.
4. Now, you can check if it is actually installed:
php80 --version
That’s it 😉
Hello,
Is it possible to install PHP 7.4-8.0 on High Sierra and keep the server app working.(Home-brew fails to install PHP on 10.13)
I don’t have high sierra installed in my local dev, but if it works on Sierra, it should works on High Sierra with MacPorts, you may search on https://ports.macports.org/?search=php74&search_by=name
Hi thank you for the answer. MacPorts installs PHP on High Sierra but I have not found a way to use it in the Apple supplied Apache installation. Macports creates a new Apache enviroment which is “incompatible with the Apple Server app for High Sierra. Do you have any ideas how to use the Php from Macports in the Apple standard installation of Apache?
For integration with apache, I think you may need to follow this documentation https://trac.macports.org/wiki/howto/PHP#install
Is it possible to install php 8.0 on MacOS X Server Sierra with Macports?
Never use macos x “Server” yet, so I don’t know