6

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.

4

3 回答 3

17

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.

于 2013-03-05T08:30:25.530 回答
12
php -d detect_unicode=Off composer.phar install

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

于 2013-07-04T09:47:46.440 回答
6

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.

于 2014-03-12T11:49:03.687 回答