Skip to content

Instantly share code, notes, and snippets.

@nickwhitt
Created May 21, 2013 03:34
Show Gist options
  • Save nickwhitt/5617325 to your computer and use it in GitHub Desktop.
Save nickwhitt/5617325 to your computer and use it in GitHub Desktop.
PHP CLI Aliases With MAMP

Assumes MAMP was installed to default location: /Applications/MAMP.

PHP v5.2.17

$> ln -s /Applications/MAMP/bin/php/php5.2.17/bin/php /usr/local/bin/php52
$> php52 -v
PHP 5.2.17 (cli) (built: Jan 21 2013 14:44:43)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v1.0-dev, Copyright (c) 2004-2012 eAccelerator, by eAccelerator

PHP v5.3.20

$> ln -s /Applications/MAMP/bin/php/php5.3.20/bin/php /usr/local/bin/php53
$> php53 -v
PHP 5.3.20 (cli) (built: Jan 21 2013 15:03:13)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v1.3.2, Copyright (c) 2005-2011, by mOo

PHP v5.4.10

$> ln -s /Applications/MAMP/bin/php/php5.4.10/bin/php /usr/local/bin/php54
$> php54 -v
PHP 5.4.10 (cli) (built: Jan 21 2013 15:12:32)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

Default

$> ln -s /usr/local/bin/php54 /usr/local/bin/php
$> php -v
PHP 5.4.10 (cli) (built: Jan 21 2013 15:12:32)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment