Skip to content

Instantly share code, notes, and snippets.

@anselmdk
Last active August 24, 2018 17:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anselmdk/aa05531954f1d44f9930 to your computer and use it in GitHub Desktop.
Save anselmdk/aa05531954f1d44f9930 to your computer and use it in GitHub Desktop.
Mamp

Mysql

This might need to be done for mysql:

sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql

Connection problems can be alleviated using this socket: /Applications/MAMP/tmp/mysql/mysql.sock

How to fix Can’t connect to local MySQL server through socket /tmp/mysql.sock

ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock

then restart mysql

https://coderwall.com/p/w5kwzw

PHP CLI

As of Mamp 4, MAMP Pro sports the option to "Make this version available on the command line" under the PHP language settings.
This does work for just using PHP on the command line, but still gives some issues with composer etc.
The issue seems to be that when checking that box, MAMP Pro adds php as an alias in your .profile/ .bash_profile file, and not as path.
In order to fix this, add the following to your ~./profile, where the php version coincides with the one MAMP uses:

PATH=/Applications/MAMP/bin/php/php5.6.27/bin:$PATH
export PATH

This needs to coincide with your installed php version

SilverStripe specific: You might get out-of-memory issues when changing this, make sure to delete all files in your silverstripe-cache directory in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment