Mamp Website



With XAMPP (Windows)

Nov 04, 2018 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. Welcome to my Tutorial Lesson 1. Building a Website for Beginners - Installing MAMPBuilding a Website for Beginners. Installing a Local Environment MAMP on a.

  • Locate your hosts file. In Windows XP, this file is located in C:WINDOWSsystem32driversetc. Different versions of Windows may store the file in a different directory. And depending on your Windows setup, you might need to be logged in as an administrator to modify the hosts file.
  • Open the file with a plain text editor (like Notepad++ or Sublime Text). In the hosts file, you should see something similar:

Right below the line 127.0.0.1 localhost, enter your domain name information. Example:

  • Put all your website files in a folder “mysite” (for example) and put it in C:xampphtdocs like this C:xampphtdocsmysite.
  • Go to C:xamppapacheconf
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include conf/extra/httpd-vhosts.conf, remove it by changing:

to:

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to C:xamppapacheconfextra and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • If not already open, open XAMPP control panel and start Apache.
  • Go to the URL: http://mysite.local/
  • You are done.

With WAMP (Windows)

Same steps as that of XAMPP just change the paths according to WAMP which corresponds to path in XAMPP.

  • Locate your hosts file. In Windows XP, this file is located in C:WINDOWSsystem32driversetc. Different versions of Windows may store the file in a different directory. And depending on your Windows setup, you might need to be logged in as an administrator to modify the hosts file.
  • Open the file with a plain text editor (like Notepad++ or Sublime Text). In the hosts file, you should see something similar:

Right below the line 127.0.0.1 localhost, enter your domain name information. Example:

  • Put all your website files in a folder “mysite” (for example) and put it inC:wampwww like this C:wampwwwmysite.
  • Go to C:wampbinapacheapacheX.X.XXconf
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include conf/extra/httpd-vhosts.conf, remove it by changing:

to:

Mamp website free

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to C:wampbinapacheapacheX.X.XXconfextra and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • Restart your server.
  • Go to the URL: http://mysite.local/
  • You are done.

With MAMP (Mac OS)

The easiest way to set up virtual hosts in MAMP is to use the commercial version of MAMP, which automates the process through the MAMP Pro console. However, if you don’t want to buy MAMP Pro, it’s quite simple to do it manually by editing two files. You need to be logged in as a Mac administrator to edit the files.

  • Locate your hosts file. This file is located in /etc/hosts. You might need to be logged in as an administrator to modify the hosts file.
  • Open your console in mac and edit your hosts file like this:
  • This opens a system file that contains the following line:
  • add your desired host name after local host:
  • Press ESC, then :wq! to overwrite and close the file.
  • Put all your website files in a folder “mysite” (for example) and put it in/Users/MyUsername/ like this /Users/MyUsername/mysite.
  • Go to /Applications/MAMP/conf/apache/
  • Open httpd.conf file using a plain text editor (like Notepad++ or Sublime Text) and if you have a “#” before Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf, remove it by changing:

to:

i.e. uncomment the line so that it can includes the virtual hosts file.

  • Go to /Applications/MAMP/conf/apache/extra/ and open httpd-vhosts.conf file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:
  • Restart your server.
  • Note: If your URLs seem to be broken make sure to set AllowOverride to “All” in the Apache config file: /Applications/MAMP/conf/apache/httpd.conf (It’s around line number 206).
  • Go to the URL: http://mysite.local/
  • You are done.

References

HomeDev BlogPHPSet up a localhost and make a web page using MAMP and...

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.

Mamp

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.

Mamp Website Template

Next, click on Open Start Page, the middle button to open the starting page.

Map Website Layouts

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:

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

Map Website For Students

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