Skip to content

Instantly share code, notes, and snippets.

@saltednut
Last active September 12, 2019 22:19
Show Gist options
  • Save saltednut/8765027ec48eeaec82d11a5573206b4e to your computer and use it in GitHub Desktop.
Save saltednut/8765027ec48eeaec82d11a5573206b4e to your computer and use it in GitHub Desktop.

install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

install latest PHP package

brew install php@7.2

add new php to path in .bashrc

echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH”' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH”' >> ~/.bashrc
source ~/.bashrc

- OR add new php to path in .zshrc

echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH”' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH”' >> ~/.zshrc
source ~/.zshrc

install libmcrypt and mcrypt php extension

brew install libmcrypt
pecl install mcrypt-1.0.1

install composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

add composer to path in .bashrc

echo 'export PATH="$HOME/.composer/vendor/bin:$PATH”' >>  ~/.bashrc
source ~/.bashrc

- OR add composer to path in .zshrc

echo 'export PATH="$HOME/.composer/vendor/bin:$PATH”' >>  ~/.zshrc
source ~/.zshrc
@johnmoney
Copy link

johnmoney commented May 3, 2018

So much googling to get mcrypt to work with 7.2...

brew install mcrypt
pecl install -f mcrypt

Confirmed with...
php -m

@saltednut
Copy link
Author

Ahh weird... I updated this to do a different method that I found. You can get libmcrypt installed via brew.

@mrspete
Copy link

mrspete commented Sep 12, 2019

Hey Brant, this is helpful! I will link to it in the updated checklist.

you've got curly quotes instead of straight double quotes on lines
4
14
15
21
22
46
52

I fixed it in my fork, but it's probably just as easy to fix it here.

@mrspete
Copy link

mrspete commented Sep 12, 2019

Also I got an error on line 36, and it looks like they changed it at https://getcomposer.org/download/

Should be
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

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