30-04-2021



HomeDev BlogPHPSet up a localhost and make a web page using MAMP and...
  1. MAMP installs a local server environment on your Windows or macOS computer, and is commonly used to develop dynamic websites. MAMP is also widely used by developers working with Content Management Systems (CMS) such as WordPress.
  2. MAMP (WAMP on Windows) gives you the ability to set up your own texting server on your computer, allowing you to test your work before making it live. The first thing that we need to do is go to download MAMP. Installation is very easy, since all you have to do is drag the specified folder to your applications folder.

MAMP is a great free local server environment that has many useful features available after its installation. The tool lets you work on your website without saving the changes directly to it. You can test your code before the data syncs to your site, and possibly breaking a critical feature.

LocalMamp

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.

Server

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.

How To Use Mamp

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:

Mamp Local Server Ip

To access this specific page, I type “localhost/add.php”

Mamp Local Server Registration

Local

Mamp Local Web Server

So now I can run my simple web application in my localhost so easily, thank to MAMP.