Skip to content

Instantly share code, notes, and snippets.

@senki
Last active May 2, 2016 02:30
Show Gist options
  • Save senki/c8258acbeb5292c7cb16 to your computer and use it in GitHub Desktop.
Save senki/c8258acbeb5292c7cb16 to your computer and use it in GitHub Desktop.
Steps necessery to upgrade php in brew

Upgrade php in brew & keep phpcs

  • still valid for v5.6.21

Every time you upgrade php, you loose phpcs command. So, you need install it again.
Prerequirement: You need to install php with pear enabled: brew install php56 --with-pear

Steps

$ brew upgrade php56

# to ensure all lib can be writable by pear
$ chmod -R ug+w /usr/local/Cellar/php56/<VERSION>/lib/php/

$ pear config-set php_ini /usr/local/etc/php/5.6/php.ini system

# write dovn all of your custon installed package
$ pear list
# Standard packages are:
#   Archive_Tar
#   Console_Getopt
#   PEAR
#   Structures_Graph
#   XML_Util

$ pear upgrade-all

$ pear install PHP_CodeSniffer

# now you can clean up old formulae
$ brew cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment