MAMP installs a local server environment in a matter of seconds on your computer. MAMP (macOS) — Download offline version; MAMP (Windows) — Download offline version. MAMP PRO is a configuration application that helps you set up and run the Apache or Nginx web servers and the MySQL 5.7 database server. Utilizing a local development environment is crucial for web developers, but it's not well documented. This guide to setting up MAMP will show you how to create your own PHP development server & how to use MAMP efficiently once you're all setup.
By the current time, MAMP had released a version for Windows. This helps Windows users have one more option set up an Apache localhost easily. So that, you can focus on coding some PHP instead of spending so much time setting up your localhost. The biggest advantage of MAMP is you just need to install and use with least manual config.
To download MAMP click here. They provide free and pro version. The install process is straightforward.
Install and create your PHP web app with MAMP
After installing, open MAMP and click on “Start Servers” to start your localhost.
When you see the two checkboxes Apache Server and MySQL Server are green, the “Start Server” button turns green and change to “Stop Server” you know that everything is set up and you’re good to go.
Next, click on Open Start Page, the middle button to open the starting page.
This page is where you can access your website, phpinfo page and something else.
Click on “My Website” to go to your page, by default MAMP is installed in your C drive and so your web root folder must be “C:/MAMP/htdocs”.It means when you type “localhost” in your browser it will show the index file in the htdocs folder. Now, I will create a new file “add.php” and copy the code of the add application I created in this post (source code is at the end of the post) into this new file. My folder now looks like this:
Map Local
To access this specific page, I type “localhost/add.php”
Mamp Localhost Refused To Connect
So now I can run my simple web application in my localhost so easily, thank to MAMP.