我正在尝试使用 MAMP 在 OSX 上安装 composer 并使用了 本指南,但是它似乎不起作用.
I'm trying to install composer on OSX with MAMP and have used this guide, but it doesn't seem to be working.
在最后一步我收到以下错误:
On the final step I get the following error:
mv: rename composer.phar to /usr/local/bin/composer: No such file or directory有谁知道可能出了什么问题?我正在使用 OSX 10.9.5 和 MAMP 3.0.7.3 和 PHP 版本 5.6.2.
Does anyone know what could be wrong? I'm using OSX 10.9.5 and MAMP 3.0.7.3 and PHP version 5.6.2.
推荐答案下载 composer.phar 并将其保存到您的项目文件夹中:getcomposer/composer.phar
Download composer.phar and save it into your project folder: getcomposer/composer.phar
然后打开你的终端并输入:
Then open your terminal and type:
nano ~/.bash_profile文件打开后,输入以下代码
Once the file is open, enter the following code
alias composer='php ~/composer.phar' export PATH=/Applications/MAMP/bin/php/php7.0.10/bin:$PATH请注意,我目前正在使用 php7.0.10 版本.只需使用您正在使用的 php 版本自定义上面的代码.
Please note that I am currently working with php7.0.10 version. Just customize the code above with the php version you're working with.
ctrl+o 保存文件ctrl+m 确认格式ctrl+x 关闭文件
ctrl+o to save the file ctrl+m to confirm format ctrl+x to close the file
现在重新加载配置文件
source ~/.bash_profile提示 composer 以检查是否正常工作
Tipe composer in order to check if is working
______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ / __ `__ / __ / __ / ___/ _ / ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.2.2如果上面的文字显示了,那么你就可以开始了!
if the text above is shown, then you're ready to go!
更多推荐
使用 MAMP 在 OSX 上安装 composer
发布评论