Skip to content

Instantly share code, notes, and snippets.

@senki
Last active November 30, 2015 09:17
Show Gist options
  • Save senki/3b147cc1527bbfcabbd2 to your computer and use it in GitHub Desktop.
Save senki/3b147cc1527bbfcabbd2 to your computer and use it in GitHub Desktop.
Steps necessery to upgrade php in brew

Steps necessery to upgrade php in brew

  • updated for 5.5.30

If You upgrade your existing php package via brew upgrade you need to manually update your pear.conf file.

Steps

$ brew upgrade php55
# or
$ brew rm php55 && install php55 --with-pear

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

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

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

# replace all previous version to the newly installed one
# (eg. 5.5.23 -> 5.5.24) in paths
$ nano /usr/local/etc/php/5.5/pear.conf 

$ pear upgrade-all

$ pear install <your custon installed package>
# example:
$ pear install PHP_CodeSniffer

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