2018-01-22

mac安裝composer & php-cs-fixer

安裝 php 7.2
brew update
brew tap homebrew/dupes
brew tap homebrew/php
brew install php72 (需php >= 7)
mv /usr/bin/php /usr/bin/php55
sudo ln -s /usr/local/bin/php /usr/bin/php

which php
# mac原本php
/usr/bin/php
# Homebrew的php
/usr/local/bin/php

# 重新安裝 PHP 7.2
brew reinstall php@7.2
# 測試重建鏈
brew link --overwrite --force --dry-run php@7.2
# 重建鏈結
brew link --overwrite --force php@7.2

安裝composer (php >= 7)
brew install composer

安裝xdebug
pecl install xdebug

安裝 php-cs-fixer
composer global require friendsofphp/php-cs-fixer
修改~/.profile
加入
export PATH="$PATH:$HOME/.composer/vendor/bin"
source ~/.profile
(或用brew: brew install homebrew/php/php-cs-fixer)

沒有留言:

張貼留言