MAMP Pro

Settings

Hosts

General

  1. Set the host name like a URL. Example: something.test
  2. Set the document root.

SSL

  1. Generate a certificate.
  2. Add and trust the certificate in your Mac’s keychain. Instructions

Automatically redirect HTTP to HTTPS:

Allow HTTP connections

Ports

Apache 80 (443 SSL)
Nginx 81 (7443 SSL)
MySQL 3306
Memcached 11211

Languages

PHP

Default version 5.6.37
Mode Identical PHP for all hosts
PHP cache Off

Apache configuration

  1. Go to File > Edit Template > Apache > httpd.conf.
  2. Add to the bottom:
# -----------------------------------------------
# GravDept:
# Enable GZIP
# -----------------------------------------------

<IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml

    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
</IfModule>

Error logs

/Applications/MAMP/logs/apache_error.log
/Applications/MAMP/logs/mysql_error_log.err
/Applications/MAMP/logs/php_error.log

Database management

Import / export

See Workspace > Mac Apps > Sequel Pro.

Assign existing user to imported database

In phpMyAdmin:

  1. Click Home icon.
  2. Click User accounts tab.
  3. Click Edit privileges link for the user.
  4. Click Database tab.
  5. Select the database from the multi-select input.
  6. Check all privileges.
  7. Click Go.

Assign global priveliges to a user

Sometimes importing a database requires global priveliges. I’m not sure why, but I don’t worry about it for a local environment.

In phpMyAdmin:

  1. Click Home icon.
  2. Click User accounts tab.
  3. Click Edit privileges link for the user.
  4. The Global tab is selected (default view).
  5. Check all privileges.
  6. Click Go.