In this tutorial, we'll install the latest version of PHP using Homebrew on macOS Big Sur, also known as macOS 11. This PHP installation features a rich set of extensions and libraries, including those required by version 4 of the CodeIgniter framework.
In the previous tutorial, we've already installed Homebrew on a fresh copy of macOS Big Sur.
Now let's open Mac's Terminal app, and simply type:
in the command prompt, and then hit the return key. In this process, your user account needs to have administrative privileges.
brew install php
This installation may typically take a while, although in this video we fast-forwarded some parts for the sake of brevity. Depending on your system and Internet bandwidth, it can take up to an hour. Therefore be patient, and do not interrupt the installation to avoid polluting your system library directories with intermediate pre-mature installation files.
Homebrew prints some instructions for additional steps to be taken which would be needed to link this very PHP installation to the Apache web server that comes bundled with macOS - though we won't be using it in our demos. In other demos on this blog (and our YouTube channel), we will be testing the web applications created with CodeIgniter Wizard using the built-in web server functionality of the CodeIgniter framework making use of the PHP libraries we are installing in this demo now. Therefore in this tutorial, I will not go along those additional steps instructed by Homebrew. However you can easily save the entire Terminal output to a log file in text format, just in case you need to refer to those instructions later, in order to properly set up a complete web development environment manually by yourself.
Now that our PHP installation is complete, in another tutorial, we'll be demonstrating how to run a web application created with CodeIgniter Wizard on this configuration - so be sure to stay tuned...