Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sbarcelona11/3722dba1f76b401aef98e1d077e1d7b7 to your computer and use it in GitHub Desktop.

Select an option

Save sbarcelona11/3722dba1f76b401aef98e1d077e1d7b7 to your computer and use it in GitHub Desktop.

Revisions

  1. @brettalton brettalton revised this gist Jan 17, 2016. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion install_composer_using_mamp_and_php7.sh
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,23 @@
    # Jan 17, 2016
    # original gist: https://gist.github.com/kkirsche/5710272

    ###########################################
    # Composer & MAMP's installation of PHP 7 #
    ###########################################

    echo "alias phpmamp='/Applications/MAMP/bin/php/php7.0.0/bin/php'" >> ~/.bash_profile
    source ~/.bash_profile
    curl -sS https://getcomposer.org/installer | phpmamp
    sudo mv composer.phar /usr/local/bin/composer

    # composer is now installed globally and can be used via 'composer' on the command line
    # Composer is now installed globally and can be used via 'composer' on the command line,
    # as well as MAMP's installation of PHP 7 is available using 'phpmamp'

    ################################
    # MAMP's installation of MySQL #
    ################################

    echo "alias mysqlmamp='/Applications/MAMP/Library/bin/mysql'" >> ~/.bash_profile
    source ~/.bash_profile

    # MAMP's MySQL installation is now available on the command line under 'mysqlmamp'
  2. @brettalton brettalton revised this gist Jan 17, 2016. 2 changed files with 10 additions and 33 deletions.
    33 changes: 0 additions & 33 deletions Install Composer to use MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -1,33 +0,0 @@
    ##Create an alias to MAMP's PHP installation

    To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

    Within the terminal, run:

    nano ~/.bash_profile

    This will open nano with the contents, at the top in a blank line add the following line:

    alias phpmamp='/Applications/MAMP/bin/php/php5.4.10/bin/php'

    This will create an alias, phpmamp, so that you can take advantage of the MAMP installation of PHP. Please take note of the PHP version, in this case 5.4.10, as with different versions of MAMP this may be different. Check your installation and see what version you have, and replace the number accordingly (this was written with MAMP version 2.1.2).

    With that setup, we are ready to install composer. This is a two step process if we would like this to be installed globally, while you would only need to do the first step if you would like this installed to the local working directory only.

    First, run the following command in the terminal:

    curl -sS https://getcomposer.org/installer | phpmamp

    Note that instead of the standard 'php' at the end, we are using 'phpmamp' so that we correctly use the MAMP installation of PHP.

    Next, we want to make this available globally, so we need to move the file to '/usr/local/bin/composer'. To do this, run the following command:

    sudo mv composer.phar /usr/local/bin/composer

    Terminal will ask you for yor password, after entering it and pressing the 'return' (or enter) key, you'll have a working global installation of composer on your mac that uses MAMP!

    You can verify your installation worked by typing the following command:

    composer

    It'll show you the current version and a list of commands you can use!
    10 changes: 10 additions & 0 deletions install_composer_using_mamp_and_php7.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Tested with Mac OS X 10.11.2 El Capitan & MAMP 3.5
    # Jan 17, 2016
    # original gist: https://gist.github.com/kkirsche/5710272

    echo "alias phpmamp='/Applications/MAMP/bin/php/php7.0.0/bin/php'" >> ~/.bash_profile
    source ~/.bash_profile
    curl -sS https://getcomposer.org/installer | phpmamp
    sudo mv composer.phar /usr/local/bin/composer

    # composer is now installed globally and can be used via 'composer' on the command line
  3. @d3cept1on d3cept1on revised this gist Jun 5, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install Composer to use MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #Create an alias to MAMP's PHP installation
    ##Create an alias to MAMP's PHP installation

    To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

  4. @d3cept1on d3cept1on renamed this gist Jun 5, 2013. 1 changed file with 1 addition and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Create an alias to MAMP's PHP installation
    #Create an alias to MAMP's PHP installation

    To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

  5. @d3cept1on d3cept1on renamed this gist Jun 5, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. @d3cept1on d3cept1on revised this gist Jun 4, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Process
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Create an alias to MAMP's PHP installation
    Create an alias to MAMP's PHP installation

    To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

  7. @d3cept1on d3cept1on created this gist Jun 4, 2013.
    33 changes: 33 additions & 0 deletions Process
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    ## Create an alias to MAMP's PHP installation

    To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

    Within the terminal, run:

    nano ~/.bash_profile

    This will open nano with the contents, at the top in a blank line add the following line:

    alias phpmamp='/Applications/MAMP/bin/php/php5.4.10/bin/php'

    This will create an alias, phpmamp, so that you can take advantage of the MAMP installation of PHP. Please take note of the PHP version, in this case 5.4.10, as with different versions of MAMP this may be different. Check your installation and see what version you have, and replace the number accordingly (this was written with MAMP version 2.1.2).

    With that setup, we are ready to install composer. This is a two step process if we would like this to be installed globally, while you would only need to do the first step if you would like this installed to the local working directory only.

    First, run the following command in the terminal:

    curl -sS https://getcomposer.org/installer | phpmamp

    Note that instead of the standard 'php' at the end, we are using 'phpmamp' so that we correctly use the MAMP installation of PHP.

    Next, we want to make this available globally, so we need to move the file to '/usr/local/bin/composer'. To do this, run the following command:

    sudo mv composer.phar /usr/local/bin/composer

    Terminal will ask you for yor password, after entering it and pressing the 'return' (or enter) key, you'll have a working global installation of composer on your mac that uses MAMP!

    You can verify your installation worked by typing the following command:

    composer

    It'll show you the current version and a list of commands you can use!