Failed to start composer.phar

Composer is a dependency management tool for PHP projects. It allows you to declare dependent libraries required for your project, and will install them in your project for you. The composer is not a package manager.

I said this to declare my meaning from Composer . I recently tried to launch my first Google API project. There is a quickStart that says I need to use Composer . So I tried to run the composer using php composer.phar install , but the only output I got was some question marks ??????? and no dependencies that were selected. I did not notice anything special about the composer himself, it seems that there should be something with .phar files that I do not know. Is there anything special about the phar file phar ? What should I do?

I googled a lot, but no one had the same problem as mine.

+6
source share
3 answers

The problem you are talking about sounds like you have a detect_unicode function in your php.ini. You have to disable it because it is really useless and creates problems with phars.

By the way, with the help of the composer’s installer, you can check the settings and warn about such problems.

+17
source
 php -d detect_unicode=Off composer.phar install 

fixed it on MacOS X, it seems that reset my php.ini from time to time

+12
source

It is approaching quite late to this question, but I would like to add that you can always run this command to check if php is configured correctly for Composer

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

This will let you know if something needs to be changed. If you get a blank result from Composer, this is the first place to ask for help.

+5
source

All Articles