Skip to content

Instantly share code, notes, and snippets.

@kylejohnston
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save kylejohnston/c004668f03eea27cd306 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnston/c004668f03eea27cd306 to your computer and use it in GitHub Desktop.
MAMP Configuration Tips
Tags: #reference #mamp #hosting #server
# Fix for MAMP when MySQL is not starting
If you get the “Error: Could not connect to MySQL server!” notice, here’s a fix:
1. Quit MAMP
2. Open the terminal and type: killall -9 mysqld
3. Restart MAMP
[Source](http://twob.net/journal/fix-for-mamp-mysql/)
---
# Setting Up Virtual Hosts
**1. Edit 'hosts' file in Terminal:**
sudo pico /etc/hosts
Edit 127.0.0.1 – add appropriate domain name (e.g. mysite.local)
Control-o, return
Control-x
**2. Edit file: /Applications/MAMP/conf/apache/httpd.conf – Add VirtualHost entry:**
`<VirtualHost *`>
DocumentRoot ~/Sites/path-to-directory
ServerName mysite.local *<– edit to reflect appropriate domain name*
Order allow,deny
Allow from all
`</VirtualHost`>
**3. Restart MAMP (Apache)**
[Source](http://brassblogs.com/tutorials/setting-up-virtual-hosts-on-mamp)
## Note
In OS X Yosemite, '.local' is reserved for the system, so specify some other fictional extension (.foo, .zzz, .lcl, etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment