![]() ![]() Please note that the following section assumes that PHP versions 7.2 and 5.6 are the only installed versions. Hence, to make the development easier, add the following content to your ~/.bash_profile file. ![]() Switching between PHP CLI binary is another uphill task. Starting and stopping services in OSX is a tedious process. Insert the following content exit Bye Shortcuts Let us configure two virtual host files to mock projects of PHP versions 5.6 and 7.2 respectively $ cd /usr/local/var/www/ $ mkdir php56 $ cd php56 We can verify by checking for open listeners on ports 9056 & 9072: $ lsof -Pni4 | grep LISTEN | grep php Start PHP-FPM services $ launchctl load -w $ launchctl load -w ~/Library/LaunchAgents/īefore proceeding further, let’s ensure that PHP-FPM is running. ![]() Create the following directory $ mkdir -p ~/Library/LaunchAgentsĬreate soft links for configuration files $ ln -sfv ~/Library/LaunchAgents/ $ ln -sfv ~/Library/LaunchAgents/ Next step is to configure auto-start on system boot. As we would be running the application in the default HTTP port 80, we would require root privileges (Privileged ports > ~/.bash_profile &. Once the installation is complete, the next job would be to configure auto-start for NGINX. Open the terminal software and execute the following command $ brew install nginx Let us assume that your terminal shell is BASH. You can learn to setup brew package manager from the article How to install a package manager for macOS. Super user access ( sudo ) and brew package manager is required to complete the installation. We are considering that the machine does not have any software installed on the default HTTP port 80. It will act as our backend datastore.Īt the time of writing this article, the available versions are listed below MariaDB – A community developed fork of the famous MySQL relational database.We use the PHP-FPM (FastCGI Process Manager) implementation. PHP – Server-side software which handles the data processing.NGINX – A high-performance web server, load balancer, reverse proxy etc. ![]() with this command: pico /usr/ local/etc/nginx/nginx.How to install NGINX, MariaDB and multiple PHP versions in macOSĪ brief introduction about the application softwares discussed in this article At first, edit the nf in this directory, e.g. The initial configuration can be found in the directory /usr/local/etc/nginx (or in /opt/homebrew/etc/nginx for Macs with Apple Silicon). You can start the installation via the following command in your Terminal: brew install nginx Code language: Bash ( bash ) Since I was not satisfied with the performance of MAMP PRO and also used my local development environment mainly within the scope of localhost and not within multiple hosts, I decided to install a combination of nginx, MySQL and PHP via brew.īrew is a package manager, which allows to install many packages without a hassle.įollowing I show you the fast installation of the packages and their basic configuration on macOS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |