

MAMP DIRECTORY CODE
The first block of code always has to be your default since Apache routes linear, which you may be familiar with using ModRewrite.ĭocumentRoot /Library/WebServer/Documents Which configures the path to your virtual hosts. This is indicated by the asterisks in the directives below.Īdd the following line of code, which enables name based virtual host mapping.Īfter that add the following block of code. Most configurations# use only name-based virtual hosts so the server doesn’t need to worry about# IP addresses. # VirtualHost: If you want to maintain multiple domains/hostnames on your# machine you can setup VirtualHost containers for them. You should see a note about Virtual Hosts, such as: Open the nf file and scroll all the way to the bottom. Open Finder and navigate to the MAMP installation directory to locate the nf configuration file. We obviously want to display the new location, whether it be a new directory or a completely different location on your local web server. If you typed “” in your web browser it’d either show a “server not found” error or display the default MAMP directory. Now that the host file has been configured we need to set up the Apache portion. This will write the file to disk and close the file. Then save the file by hitting ESC and typing SHIFT+: then type “ wq” and hit ENTER. Replace mysite with your desired subdomain.
MAMP DIRECTORY PASSWORD
Once you enter your password you’ll be presented with a text editor. Type “i” to be able to edit the file, navigate (with arrow keys) to the 127.0.0.1 localhost line and replace it with: Though you will be required to enter your password to save your changes.

Note: If you use TextMate you could replace the “vi” portion with “mate” and it will open the host file inside TextMate for much quicker editing. The sudo command will require you to enter your password, and assumes temporary or “sudo” root for this task. You cannot see this file in Finder due to it being hidden (though PathFinder can) so open Terminal (/Applications/Utilities/Terminal) and type the following command Start by editing the host file, located in the root of your computer. However for my own future use and anyone else interested I figured i’d write a quick little post about the process.įor those unfamiliar with what MAMP is, you can check it out here.Īs the title states this guide is for MAMP installations however most of the information can be re-used for other systems. After scouring the internet for quite some time and getting conflicting tips/tricks I finally got everything configured. If you’re tempted to find and edit the correct php.ini in the file system on your own… good luck.While working on a project I found the need to create subdomains on my local server to shorten the localhost URL and test some of the core features I was in the process of developing.

MAMP runs slowly compared to production servers, so it needs extra time to do things. Don’t forget start MAMP’s MySQL server if it’s not already running. Close your terminal session and open a new one. You can also run mysql and mysqldump commands on MAMP’s database when you need to.

Now terminal will look for mysql in MAMP’s bin directory first. Add this line to the top: export PATH="/Applications/MAMP/bin/php/php7.0.27/bin:$" It’s a hidden file on Macs, so if you don’t see it, press Command+Shift+. Now go to your user folder, find and edit. bash_profile file in your user directory. :/Applications/MAMP/bin/php/php7.0.27/lib/php Find include_path on that page, and you will see something like this. In Craft’s Control Panel go to Utilities > PHP Info.
