How to use MAMP (Mac Apache MySql php)
Running your project with MAMP
MAMP - basic usage
- Click ‘Start’ button to start Apache, PHP, MySQL
- Click the ‘Preferences’ cog button to:
- Set port number for Apache and MySQL
e.g. Apache Port: 80, MySQL Port: 3306 - Set the root folder of the project
e.g. Users/UserName/Sites/Project/public_html
- Set port number for Apache and MySQL
- If the desired PHP version is not listed in the php drop down of MAMP:
- Rename other php folders in Applications/MAMP/bin/php — MAMP only shows 2 of the latest php versions
e.g. rename ‘php8.0.0’ too ‘php8.0.0_RENAME_TO_ENABLE’
- Rename other php folders in Applications/MAMP/bin/php — MAMP only shows 2 of the latest php versions
- Log files:
- All log files are stored in: /Applications/MAMP/logs/
- The logs need to be enabled on Apache, in the file: /Applications/MAMP/conf/apache/httpd.conf
#CustomLog /Applications/MAMP/logs/apache_access_log combined
— remove '#' to uncomment this line:
CustomLog /Applications/MAMP/logs/apache_access_log combined - Apache will write the access logs into /Applications/MAMP/Library/logs/access_log.
- Restart MAMP Apache server: press 'Stop' button, then 'Start' button.
Config files
Add a new project:
- Add a new item to hosts list in: /etc/hosts
- Add a new block in the config file:
- Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
- Make sure all the paths are correct
- Restart MAMP
Useful information:
- If you want to maintain multiple domains/hostnames on your machine you can setup VirtualHost containers for them.
- Most configurations use only name-based virtual hosts so the server doesn't need to worry about IP addresses.
- You may use the command line option '-S' to verify your virtual host configuration.
Example of the httpd-vhosts.conf file:
NameVirtualHost *:80
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests
# that do not match a ServerName or ServerAlias in any block.
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Applications/MAMP/Library/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
# EXAMPLE PROJECT 1
##################################
AcceptPathInfo on
DocumentRoot /Users/UserName/Sites/ExampleProject1/public_html
ServerName dev.example1
ErrorLog /Users/UserName/Sites/ExampleProject1/logs/error.log
CustomLog /Users/UserName/Sites/ExampleProject1/logs/access.log common
DirectoryIndex index.php
AllowOverride all
Order allow,deny
Allow from all
# EXAMPLE PROJECT 2
##################################
AcceptPathInfo on
DocumentRoot /Users/UserName/Sites/ExampleProject2/public_html
ServerName dev.example2
ErrorLog /Users/UserName/Sites/ExampleProject2/logs/error.log
CustomLog /Users/UserName/Sites/ExampleProject2/logs/access.log common
DirectoryIndex index.php
AllowOverride all
Order allow,deny
Allow from all
Other blog items
AI UK 2024
The AI UK Conference held on the 19th and 20th of March 2024
Should you be selling something else?
Engage your website visitors
What is your number one service or product?
Teaching Ethics to AI
I will be back!
Blockchain Consensus for change
It's More than Just Crypto Currency
How AI Benefits Business
5 Business Benefits of AI
London Drum Company New Site Launch
Online Drum and Percussion Hire
How much do you share?
Privacy at a bus stop
Google Analytics
Introducing BTR International
International move management services
DragonVet: a Hand-crafted Digital Presence
Make your message clear
How and Why has Launched
A website made to stand out from the crowd
Merlin Engine API builder
Get Ready… It’s Almost Here!
How to prevent Phishing
Phishing is associated with a particular type of nasty fraud.
General Data Protection Regulation
This new regulation comes into enforcement on the 25th of May 2018.
Lasting Impressions for ExpressionEngine
Lasting Impressions is ExpressionEngine 4 ready!
Cyber Security
Five tips on how to keep your business safe
Is Your Website Rubbish?
How to measure its success online
Top tips to woo customers
Things that customers love
Top mistakes that lose you customers
Top 5 mistakes to avoid when publishing on the internet.
Is your Web Site Ready for Brexit?
Leaving the EU will bring both threats and opportunities
Primary School Children Code HTML
Curse of the Brochure Site
Missing the opportunity
A Web “Page”
It’s NOT a page!
Expression Engine MSM and CartThrob
Using the same channel to sell items on different sites
Exceptionally Dull Weirdos
This is a response to Willard Foxton's recent article on the Daily Telegraph blog
The Website Machine
What is a website?