Many users confuse with the URL of localhost setup in MAMP. The fact is that the URL depends on the ports you choose to use for your local server. Go to “Ports” tab when you are in the “Preferences” section. Click on “MAMP default” or “80 & 3306” button to setup the server / MySQL ports accordingly. Mar 21, 2018 localhost and 127.0.0.1 are port loopbacks on a single machine. To access from a different machine you will need to use the xampp machines ip address or computer name. Get your xampp machine name (ie. URL が localhost/MAMP に変わっていれば完了です。 スタートページの日本語化 Welcome to MAMP ページを日本語で表示したい場合は 【MAMP】バージョン 6.x を日本語化する方法 をお読み下さい。. After successful installation you can launch your local servers. Start MAMP and click on the Start Servers button. In the status display in the upper right corner, the launch status of the servers is displayed. The web server (Apache) starts by default on port.
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.
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:
To access this specific page, I type “localhost/add.php”
So now I can run my simple web application in my localhost so easily, thank to MAMP.
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.Right below the line 127.0.0.1 localhost, enter your domain name information. Example:
C:xampphtdocs
like this C:xampphtdocsmysite
.C:xamppapacheconf
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: Yt music.
i.e. uncomment the line so that it can includes the virtual hosts file.
C:xamppapacheconfextra
and open httpd-vhosts.conf
file using a plain text editor (like Notepad++ or Sublime Text) and add the following code:http://mysite.local/
Same steps as that of XAMPP just change the paths according to WAMP which corresponds to path in XAMPP.
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.Right below the line 127.0.0.1 localhost, enter your domain name information. Example:
C:wampwww
like this C:wampwwwmysite
.C:wampbinapacheapacheX.X.XXconf
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:
Wonderswan emulator pc. i.e. uncomment the line so that it can includes the virtual hosts file.
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:http://mysite.local/
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.
hosts
file. This file is located in /etc/hosts
. You might need to be logged in as an administrator to modify the hosts file./Users/MyUsername/
like this /Users/MyUsername/mysite
./Applications/MAMP/conf/apache/
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.
/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:/Applications/MAMP/conf/apache/httpd.conf
(It’s around line number 206).http://mysite.local/