At the end of this tutorial you will be able to setup and configure LEMP stack on MAC OSX with PHP-FPM.
Step 1: Update your XCode from App Store
Step 2: Install and update Homebrew
Make sure you don’t get any major errors after running brew doctor command. Small warnings are okay.
Step 3: Install PHP-FPM
Setup PHP CLI binary
Update the $PATH environment variable of your shell profile for using PHP Command Line Tools.
Setup Auto Start
Create a folder for the LaunchAgents and symlink the start/stop service:
Install the latest MariaDB
Now check your MariaDB version first and run the following commands according to your version.
Now start MariaDB
Secure the MariaDB Installation
Set the root password as you wish.
Now connect to MariaDB
Enter your password and try to run the basic commands to see if you have any errors with the installation.
Start Nginx for the first time
Setup auto launch Nginx as root
Create the following folders for logs, virtual servers and etc.
Remove the current Nginx configuration file.
The file is also available in /usr/local/etc/nginx/nginx.conf.default.
Create a new file then copy and paste the following content;
That’s it for Nginx configuration! I will be adding the configuration samples for virtual hosts soon.