Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save vishalkakadiya/c1b22d446b08aaed7227bdf4b534e331 to your computer and use it in GitHub Desktop.

Select an option

Save vishalkakadiya/c1b22d446b08aaed7227bdf4b534e331 to your computer and use it in GitHub Desktop.

Revisions

  1. @irazasyed irazasyed revised this gist Nov 28, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ##Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
    ## Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
    ---

    ### Instructions to Change PHP Installation
    @@ -17,7 +17,7 @@ Now, We just need to swap this over to the PHP that is installed with MAMP, whic

    To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP to the PATH variable.

    ####Follow these simple steps:
    #### Follow these simple steps:
    ---
    1. Within the Terminal, run `vim ~/.bash_profile`

    @@ -36,7 +36,7 @@ To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP
    ### Install Composer Package Management
    ---

    Now you can fire the commands to install the composer (global):
    Now you can fire the command to install the composer globally (So you can access it from anywhere):

    $ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

  2. @irazasyed irazasyed revised this gist Nov 28, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -38,8 +38,7 @@ To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP

    Now you can fire the commands to install the composer (global):

    $ curl -sS https://getcomposer.org/installer | php
    $ mv composer.phar /usr/local/bin/composer
    $ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

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

  3. @irazasyed irazasyed revised this gist Nov 28, 2015. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ##Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
    ---

    ###Instructions to Change PHP Installation
    ### Instructions to Change PHP Installation
    ---
    First, Lets find out what version of PHP we're running (To find out if it's the default version).

    @@ -31,7 +31,9 @@ To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP

    5. In Terminal, type in `which php` again and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install.

    ###Install Composer Package Management
    6. In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).

    ### Install Composer Package Management
    ---

    Now you can fire the commands to install the composer (global):
  4. @irazasyed irazasyed revised this gist Nov 28, 2015. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -34,13 +34,10 @@ To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP
    ###Install Composer Package Management
    ---

    Now you can fire the command to install the composer:
    Now you can fire the commands to install the composer (global):

    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin

    After the download & installation is done, You can add this alias to your `.bash_profile` or `.profile` file to get `composer` to work globally instead of `php /usr/bin/composer.phar` command.

    alias composer="php /usr/bin/composer.phar"
    $ curl -sS https://getcomposer.org/installer | php
    $ mv composer.phar /usr/local/bin/composer

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

  5. @irazasyed irazasyed revised this gist Mar 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    ---
    First, Lets find out what version of PHP we're running (To find out if it's the default version).

    To do that, Withing the terminal, Fire this command:
    To do that, Within the terminal, Fire this command:

    which php

  6. Syed I.R created this gist Jul 12, 2013.
    49 changes: 49 additions & 0 deletions Install Composer using MAMP's PHP.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    ##Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
    ---

    ###Instructions to Change PHP Installation
    ---
    First, Lets find out what version of PHP we're running (To find out if it's the default version).

    To do that, Withing the terminal, Fire this command:

    which php

    This should output the path to the default PHP install which comes preinstalled by Mac OS X, by default it has to be (Assuming you've not changed it before):

    /usr/bin/php

    Now, We just need to swap this over to the PHP that is installed with MAMP, which is located at `/Applications/MAMP/bin/php/php5.4.10/bin` (MAMP 2.1.3)

    To do this, We need to edit the `.bash_profile` and add the MAMP version of PHP to the PATH variable.

    ####Follow these simple steps:
    ---
    1. Within the Terminal, run `vim ~/.bash_profile`

    2. Type `i` and then paste the following at the top of the file:

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

    3. Hit `ESC`, Type `:wq`, and hit `Enter`

    4. In Terminal, run `source ~/.bash_profile`

    5. In Terminal, type in `which php` again and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install.

    ###Install Composer Package Management
    ---

    Now you can fire the command to install the composer:

    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin

    After the download & installation is done, You can add this alias to your `.bash_profile` or `.profile` file to get `composer` to work globally instead of `php /usr/bin/composer.phar` command.

    alias composer="php /usr/bin/composer.phar"

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

    composer

    It'll show you the current version and a list of commands you can use if the installation was successful.