Create a gist now

Instantly share code, notes, and snippets.

@bobthecow /install.sh Secret
Last active Feb 19, 2017

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 script saved me in installing symfony!

@brettalton

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

@bobthecow
Owner

@brettalton copypasta. It's fixed now :)

@grantgeorge

you're the man! Thank you

@marcandreappel

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

@rockymontana
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
zx1986 commented Apr 13, 2015

太棒了!萬分感謝!

@df365
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 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 will probably need PEAR to be installed: brew install php56 --with-pear. To remove outdated packages, use brew cleanup.

@universe416

Thank you !!!!

@vikramsurya

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.


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