Using Docker Nginx, PHP, MySQL on Mac. Ask Question Asked 2 years, 9 months ago. Active 2 years, 9 months ago. Viewed 2k times 1. I'm just starting to get my. This tutorial shows how to install Nginx + PHP + MySQL on Mac OS Catalina. It’s very straightforward process and doesn’t takes you more than 10 to 15 minutes. Install PHP First of all, ensure that brew brew is up-to-date and then install latest php 7.4 version. To locate your ini files type the following. In this article, I am going to share my experience for how to install NGINX, PHP and MySQL on your Mac. This article is for someone interesting to set-up web development environment, especially for the first time. Reson I choose Nginx over Apache web server is its. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows the installation of Nginx with PHP support (through PHP-FPM) and MySQL and MariaDB. This setup is often referred to as LEMP = Linux + nginx (pronounced 'engine x') + MySQL + PHP). The free web development solution with Apache, Nginx, PHP & MySQL What is MAMP? MAMP installs a local server environment in a matter of seconds on your Windows or macOS computer.
![Debian 10 nginx php mysql Debian 10 nginx php mysql](/uploads/1/1/8/7/118798584/186969189.jpg)
Nginx is an Apache alternative web server in the open source category to support several internet protocols such as HTTP (S), IMAP, and POP3. It can also be used as a reverse proxy with WebSocket support. The server offers a gunzip module, whereby compressed web pages can be unpacked before being sent to the browser.
Here we will learn the process of installing Linux+Nginx+PHP+MySQL stack on Windows 10 Subsystem for Linux using Ubuntu 20.04 LTS WSL distro…
Steps to install LEMP server on Ubuntu 20.04 LTS WSL
Steps to install LEMP server on Ubuntu 20.04 LTS WSL
Enable WSL on your Windows 10
I am assuming that you already have enabled WSL 1 or WSl 2 on your Windows 10 system, If not then go to the search box and type “Turn Windows feature on or off” after that select Windows Subsystem for Linux to enable it. For more information related to it, you can see our tutorial: how to install WSL on Windows.
Install Ubuntu 20.04 LTS WSL distro
Previously, the long term versions of the Ubuntu available as WSL app on Microsoft store were 18.04 and 16.04 but now the Ubuntu 20.04 LTS focal fossa is the latest one, thus the same can be downloaded from the MS- App store. Here is the link.
Run Update and Upgrade commands
After the installation of the Ubuntu 20.04 and setting up the user name and password run the below-given system update and upgrade commands. This will make sure all the system available packages on this Linux are up to date and in their latest state.
Install PHP on WSL
First let’s check which version of PHP is currently available on the Ubuntu 20.04 LTS to install, for that use the below command:
Now according to your PHP version, use the below command. Note: replace the 7.4 with the version number available for your system.
Install Nginx web server on Ubuntu 20.04 Windows 10
Just like Apache, the Nginx is also available to install in the default repository of Ubuntu, therefore no need to add any third-party repo. Just use the APT package manager to download and install it on your system.
Start Nginx services
By default, the Nginx web server service will not be activated and we have to do that manually using the command. Thus run
When Windows Firewall asks you to allow the webserver services to access through the public network, allow it.
Check the status
Optional: Commands to stop and restart the Nginx web server services
![Mysql Mysql](https://www.jetbrains.com/help/img/idea/2020.2/ps_mamp-pro-connect-mysql.png)
Access Nginx through the browser
Open your system browser and type http://127.0.0.1 or http://localhost or http://your-system-ipaddress
Nginx Mysql Php Windows
Start PHP-fpm service
Start PHP-fpm to start with Nginx:
Configure PHP-fpm for Nginx on Windows 10 WSL
Open the php-fpm configuration file
In the file find the PHP-fpm listening socket path:
Change that to
If you are using some other version of PHP then replace the php7.4 with that version or manually navigate to the path to check the FPM socket file.
Now, open Nginx Default site configuration
In the default site configuration, to use PHP with Nginx, first, we have to add index.php in that…
Nginx Php Setup
Find the below line and add index.php to the list.
# For example:
Now find the below lines and do editing as mentioned below:
Remove the # or uncomment the following lines which we have done here…
After all the changes press CTRL+X and type Y and then press the Enter button to save the changes.
Restart Nginx and PHP-FPM services
Step 9: Create a test PHP file
Nginx Php Mysql For Mac Os
Create an index.php file
Open it:
And add the following lines in that ]
Again press CTRL+X and type Y then press the enter button to save it.
Now, open the browser and type
http://localhost
Note: The root directory to save your project, so that you can call it using Nginx in the browser is just like Apache, i.e
/var/www/
Finally, Install MySQL Server
The officially available version of MySQL version to install on Ubuntu 20.04 WSL is MySQL 8.0.