Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Gerardlc/b30965566ccde9230269c60b55ee9e66 to your computer and use it in GitHub Desktop.

Select an option

Save Gerardlc/b30965566ccde9230269c60b55ee9e66 to your computer and use it in GitHub Desktop.

Revisions

  1. Alexander Andrés Londoño Espejo revised this gist Jun 30, 2016. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion Laravel requires the Mcrypt PHP extension
    Original file line number Diff line number Diff line change
    @@ -56,4 +56,13 @@ Switch to PHP 5.5
    brew unlink php54
    brew unlink php53
    sudo ln -s /usr/local/bin/php55 /usr/local/bin/php
    sudo ln -s /usr/bin/php55 /usr/bin/php
    sudo ln -s /usr/bin/php55 /usr/bin/php





    How to use MAMP's version of PHP instead of the default on OSX - Stack Overflow
    CON ESTE COMANDO ME FUNCIONÓ

    sudo mv /Applications/MAMP/bin/php/php5.6.10/bin/php /usr/bin/php
  2. Alexander Andrés Londoño Espejo created this gist Jun 28, 2016.
    59 changes: 59 additions & 0 deletions Laravel requires the Mcrypt PHP extension
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@

    Change default Mac OS X PHP to MAMP's 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).

    To do that, Within 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:

    Within the Terminal, run vim ~/.bash_profile

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

    export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
    Hit ESC, Type :wq, and hit Enter

    In Terminal, run source ~/.bash_profile

    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.

    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).




    SOLUCION DE MI PROBLEMA
    Yosemite comes with Apache 2.4 & PHP 5.5 preinstalled. You don't need MAMP, only MySQL or MariaDB.

    Regardless, you can use PHP 5.5, PHP 5.4 or PHP 5.3 as needed. Try the following...

    sudo mv /usr/local/bin/php /usr/local/bin/php55
    sudo mv /usr/bin/php /usr/bin/php55
    Install PHP 5.4

    brew install php54 php54-mcrypt php54-mysql
    Install PHP 5.3

    brew unlink php54
    brew install php53 php53-mcrypt php53-mysql
    Switch to PHP 5.4

    brew unlink php53
    brew link php54
    Switch to PHP 5.5

    brew unlink php54
    brew unlink php53
    sudo ln -s /usr/local/bin/php55 /usr/local/bin/php
    sudo ln -s /usr/bin/php55 /usr/bin/php