Not able to run composer.phar

徘徊边缘 提交于 2019-12-10 13:33:22

问题


Composer is a tool for dependency management in PHP projects. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. Composer is not a package manager.

I told this to declare my meaning from Composer. Recently I have tried to run my first Google API project. There is a quickStart witch tells I need to use Composer. So I tried to run composer using php composer.phar install, but the only output I got was some question marks ???????, and no dependencies where fetched. I haven't noticed anything special about composer itself, it seems that there must be something with .phar files that I don't know. Is there anything special in the architecture of phar files? What should I do?

I googled a lot, but there was nobody having the same problem as mine.


回答1:


The issue you describe sounds like you have detect_unicode enabled in your php.ini. You should disable it because it really is of no use and creates problems with phars.

By the way using the composer installer would do a check of settings and warn you about such problems.




回答2:


php -d detect_unicode=Off composer.phar install

fixed it on MacOS X, it seems to reset my php.ini every now and then




回答3:


Coming pretty late to this question, but I'd like to add that you can always run this command to verify php is configured correctly for Composer

curl -s https://getcomposer.org/installer | php -- --check

That will let you know if anything needs to be amended. If you get a blank output from Composer, that's the first place to go for help.



来源:https://stackoverflow.com/questions/15216292/not-able-to-run-composer-phar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!