其他分享
首页 > 其他分享> > SLOW COMPOSER ON OS X?

SLOW COMPOSER ON OS X?

作者:互联网

If your composer install is painfully slow, then this might be the fix for you.  I got to a point where it was taking a REALLY long time to run simple updates using PHP 5.6.15.  Sure sure, PHP7 is around the corner, but I couldn't sacrifice my dev environment which reflects our deploy requirements.

FIRST, HOMEBREW

If you don't have Homebrew on your machine, well, it's never too late to do the right thing.  You can get more details at http://brew.sh.  Installation is simple:

Bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

THEN, HHVM

If you aren't familiar with HHVM, it's all here: http://hhvm.com.  Essentially, it was a turbocharged PHP created by the folks at Facebook.  They did excellent work to be honest, and the performance gains were staggering. Performance differences between PHP7 and HHVM were certainly the elePHPhant in the room.

Get HHVM installed with Homebrew like so:

Bash
brew tap hhvm/hhvm
brew install hhvm

That one will take awhile.  Go Netflix'n'chill for a few and check it when you're "done".

 

LAST, COMPOSER ALIAS

This part is very simple.  You just need to create an alias in your ~/.bash_profile file.  If it doesn't exist, create it.  From Terminal, issue this command:

Bash
pico ~/.bash_profile

Then, add this alias into it

Bash
alias composer="hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar"

Hit CTRL+X, answer Yes to save, and then refresh your session with:

Bash
source ~/.bash_profile

That's it!  You should be able to head into your composer project and issue a magical composer update that's 10 times faster than its ever been!

Let me know how things pan out!

标签:SLOW,COMPOSER,install,HHVM,composer,hhvm,OS,your,Bash
来源: https://www.cnblogs.com/haiwei_sun/p/12395040.html