As a web designer and front-end developer, I am constantly building websites that require PHP, an Apache Server and a MySQL Server. A majority of time I use WordPress, which requires all three processes.
There are also many benefits to developing a website locally. It is amazing how much time is saved when developing and making changes to a website when you do not have to interact with a server via FTP (File Transfer Protocol). Developing locally also allows the developer to find errors that might exist without it affecting user experience, which means you have a completed site upon launch that has been tested thoroughly.
MAMP creates a local server environment on Mac OSX by installing PHP, MySQL and Apache right out of the box. If you are familiar enough with using the built-in Apache server, you can skip this step. If you are not going to use MAMP, I recommend using a Virtual Machine because, although the OSX Apache server may seem easy enough, it is doesn’t usually grow as robust as the requirements sometimes needed.

The first thing we need to do is go download MAMP. Download it to your desktop, because we are going to be deleting it later anyway. For now we are going to use the free version, but if it turns out you will be using MAMP a lot, I recommend purchasing MAMP Pro because it offers more features out of the box and is updated more often.
Installing MAMP is exactly the same as installing any software, so if you are comfortable with installing Applications, you can skip to the next step.

Unarchive the file once it is downloaded and then mount it by double clicking the file.

Drag the application file to the Applications shortcut folder. This will install MAMP on your system. After the install is complete you can delete all the files on your desktop and unmount the MAMP volume.
Go ahead and launch MAMP from your applications folder. Your web browser will be directed to the “Welcome to MAMP” webpage on startup (you can change whether it opens this page on launch in the future within preferences). You can close the default webpage for now.

The next step is to change the default ports and location of the local web server. Let’s switch over to the application and click the “Preferences” button.

You will notice that the ports configured for Apache and MySQL by default are 8888 and 8889 respectively. We need to change that. Click the “Set to default Apache and MySQL ports” button to change the ports for Apache and MySQL to 80 and 3306 respectively. Doing this allows us to access the local server by hitting http://localhost rather than hitting the server by http://localhost:8888.

Once the port numbers have been changed, you need to change the default location of the server. The default location is set to a htdocs folder within the MAMP application folder.

Let’s change the document root to the sites folder within your user profile. This is the location where you will put the files for you local website. This also ensures that all of the websites we build will not be trashed if MAMP is deleted in the future.

Now, let’s test to see if everything is working correctly. Open the start page.

When the welcome page displays, you should see the statement verifying that MAMP has been installed correctly and is running without errors.

Now we need to test that phpMyAdmin is working correctly. Click on the phpMyAdmin button. Congratulations, you now have a local server environment. Now, have fun and start building websites that can be accessed by http://localhost within any browser on your computer.
Leave a Response