In the absence of a global Composer, if you run the Composer command in a directory that does not have Composer installed, such as: The Create-project system will return:
Could not open input File:composer.phar
Well, come and find out why, take a look at Composer's documentation says to move the Composer to the/usr/local/bin directory:
MV Composer.phar/usr/local/bin/composer
Run the Composer command again, or the same ah, to turn over the Composer document, all Composer commands have a PHP example:
PHP Composer.phar Update
Composer relies on PHP, OK, at least not Composer problem, it may be the problem of PHP, we all know that the MAC factory when the system pre-set a PHP and we use the MAMP php, probably the problem is here, in the Terminal run a bit :
Which php/usr/bin/php
The problem is confirmed, is the PHP problem, exactly is the PHP environment configuration problem, to manually configure the environment it:
sudo nano ~/.bash_profile
# adds a row. Note PHP5.4.10 changes to the name of the PHP version directory that you are running
export path=
"/applications/mamp/bin/php/php5.4.10/bin: $PATH"
# Save, Exit
# Run the. bash_profile file : Bash_profile
# Verify which PHP which PHP/APPLICATIONS/MAMP/BIN/PHP/PHP5 is currently running.
4.10/bin/php
Well, so far the PHP runtime environment has been configured to reinstall Composer:
CD /usr/local/bincurl
-s s Https://getcomposer.org/installer | Phpcomposer successfully installed to:/usr/local/bin/composer.pharuse it:php composer.phar
# Modify Composer.phar Permissions for file
sudo chmod a+x composer.phar
Pmicrosoft Yahei ', Sans-serif; font-size:14.9499998092651px; letter-spacing:1.5px; Margin-top:0px!important "> Oh, come on, run the Composer command:
CD /my/project/path
# Note that there is no need to add PHP in front of the Composer.phar command COMPOSER.P Har create-projectcomposer.phar self-updatecomposer.phar installcomposer.phar update
Fix it! At this time, should eat meal, should go to bed goes to bed.
Above describes the modification of the MAC default PHP runtime environment, to MAMP configuration global Composer, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.