Instantly share code, notes, and snippets.

@bobthecow /install.sh Secret
Last active May 7, 2018

Embed
What would you like to do?
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php56
# Fix PEAR permissions
chmod -R ug+w `brew --prefix php56`/lib/php
pear config-set php_ini /usr/local/etc/php/5.6/php.ini
# Fix PEAR config and upgrade
pear config-set auto_discover 1
pear update-channels
pear upgrade
# Install PHP extensions
# You might want some more. Use `brew search php56` to see what's available.
brew install php56-mongo php56-memcache
# You'll want Composer
brew install composer
# Install some important Composer packages globally
composer global require phpunit/phpunit:~4.2
composer global require squizlabs/php_codesniffer:~1.5
composer global require fabpot/php-cs-fixer:~0.5
composer global require psy/psysh:~0.1
# Make sure to add Composer's `bin` directory to your $PATH
# … or none of these will work.
# Set "PSR-2" as your default coding standard
phpcs --config-set default_standard PSR2
@jeffstumpf1

This comment has been minimized.

jeffstumpf1 commented Feb 8, 2014

This script saved me in installing symfony!

@brettalton

This comment has been minimized.

brettalton commented Sep 10, 2014

Why do you install php56 and then install php54-* extensions?

@bobthecow

This comment has been minimized.

Owner

bobthecow commented Nov 3, 2014

@brettalton copypasta. It's fixed now :)

@grantgeorge

This comment has been minimized.

grantgeorge commented Feb 10, 2015

you're the man! Thank you

@marcandreappel

This comment has been minimized.

marcandreappel commented Mar 2, 2015

Super! As I'm new to Mac and Homebrew, that helped me a lot, thank you!

@rockymontana

This comment has been minimized.

rockymontana commented Mar 26, 2015

Error: Unable to guess PHP branch for Formulary::Formulae::Php56Apcu

when I try to install any extensions (just switch Php56Apcu to other package name). 😢

@zx1986

This comment has been minimized.

zx1986 commented Apr 13, 2015

太棒了!萬分感謝!

@df365

This comment has been minimized.

df365 commented Dec 25, 2015

Got the following after 'brew install php56':

Error: undefined method desc' for Formulary::Formulae::Php56:Class Please report this bug: https://git.io/brew-troubleshooting /usr/local/Library/Taps/homebrew/homebrew-php/Formula/php56.rb:5:inclass:Php56'
/usr/local/Library/Taps/homebrew/homebrew-php/Formula/php56.rb:3:in load_file' /usr/local/Library/Homebrew/formulary.rb:92:inmodule_eval'
/usr/local/Library/Homebrew/formulary.rb:92:in load_file' /usr/local/Library/Homebrew/formulary.rb:82:inklass'
/usr/local/Library/Homebrew/formulary.rb:71:in get_formula' /usr/local/Library/Homebrew/formulary.rb:200:infactory'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in block in formulae' /usr/local/Library/Homebrew/extend/ARGV.rb:16:inmap'
/usr/local/Library/Homebrew/extend/ARGV.rb:16:in formulae' /usr/local/Library/Homebrew/cmd/install.rb:41:ininstall'
/usr/local/Library/brew.rb:135:in `

'

@tomsihap

This comment has been minimized.

tomsihap commented Jan 20, 2016

This is awesome!
Some issues :

first issue
$ composer global require fabpot/php-cs-fixer:~0.5
Changed current directory to /Users/tomsihap/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- fabpot/php-cs-fixer v0.5.0 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.1 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.2 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.3 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.4 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.5 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.6 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.7 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- Conclusion: don't install sebastian/diff 1.1.0
- Installation request for fabpot/php-cs-fixer ~0.5 -> satisfiable by fabpot/php-cs-fixer[v0.5.0, v0.5.1, v0.5.2, v0.5.3, v0.5.4, v0.5.5, v0.5.6, v0.5.7].

Installation failed, reverting ./composer.json to its original content.

Second issue
$ phpcs --config-set default_standard PSR2
zsh: command not found: phpcs

@franz-josef-kaiser

This comment has been minimized.

franz-josef-kaiser commented Jan 20, 2016

This will probably need PEAR to be installed: brew install php56 --with-pear. To remove outdated packages, use brew cleanup.

@universe416

This comment has been minimized.

universe416 commented Sep 26, 2016

Thank you !!!!

@vikramsurya

This comment has been minimized.

vikramsurya commented Feb 19, 2017

Error below -- any help?

composer global require fabpot/php-cs-fixer:~0.5
returns:
Changed current directory to /Users/vikram/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- fabpot/php-cs-fixer v0.5.0 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.1 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.2 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.3 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.4 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.5 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.6 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- fabpot/php-cs-fixer v0.5.7 requires sebastian/diff 1.1.* -> satisfiable by sebastian/diff[1.1.0].
- Conclusion: don't install sebastian/diff 1.1.0
- Installation request for fabpot/php-cs-fixer ~0.5 -> satisfiable by fabpot/php-cs-fixer[v0.5.0, v0.5.1, v0.5.2, v0.5.3, v0.5.4, v0.5.5, v0.5.6, v0.5.7].

Installation failed, reverting ./composer.json to its original content.


@vukanac

This comment has been minimized.

vukanac commented Aug 20, 2017

brew tap homebrew/dupes
brew tap homebrew/versions

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.

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