Setting up High Sierra for Local Web Development with PHP 5.5 Support
I love my local development environment and workflows. Depending on what's needed, I'll either use local Apache on OSX or a Vagrant box. The flexibility of having the choice of environment works for me. What doesn't work for me is having to re-set it up every time I upgrade OSX. *sigh*
Whenever it's time to go through this rigamarole, I know I can trust the guides by Grav. I haven't had need for their CMS, but if their tech guides are anything to go by, I'd definitely give them a look in if the situation arose. It's because of them that this is going to be a pretty lean guide, mainly for my own reference, with the addition of needing to support PHP 5.5 for some clients running some legacy software on their internal systems.
Step 1: Follow the Grav Guide
Cheating I know, but it's a really good guide, and while I'd done most of it for previous versions of OSX, invariably there was some small change I needed to make, and this helped me ensure I hadn't missed anything.
Find the guide here. It will help you to set up Apache, MariaDB and the sphp
PHP Switching script to switch between multiple versions of PHP.
Step 2: Add PHP 5.5 Support
The guide above allows you to switch between PHP 5.6, 7.0, 7.1 and 7.2. But if you're like me, and need to continue to support a PHP 5.5 setup (even though it's long past EOL, etc, etc), you'll find that homebrew/php
has been archived and PHP 5.5 is no longer available out of the box.
Enter this kind soul and their PHP 5.5 tap.
You will also need to make two edits your sphp
script to add support for 5.5:
And with that done, you can now carry on with your life until the next OSX upgrade.