尝试安装 composer 以设置 Laravel 框架 [英] Trying to install composer to get set up with Laravel framework

查看:21
本文介绍了尝试安装 composer 以设置 Laravel 框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Mac 上安装 composer,以便我可以使用 Laravel 框架.我通过终端成功下载了composer,然后使用以下命令将composer.phar移动到usr/local/bin:sudo mv composer.phar/usr/local/bin.

I am trying to install composer on my Mac so that I can use the Laravel framework. I successfully downloaded composer through the terminal, and then I moved composer.phar to to usr/local/bin using the command: sudo mv composer.phar /usr/local/bin.

然后我将目录更改为包含 laravel-master 文件的根目录.在终端切换到这个目录后,然后使用命令:composer install

I then changed directories to my root directory where I have the laravel-master files. After changing to this directory in the terminal, and then using the command: composer install

我收到错误:-bash: composer: command not found

我尝试了其他变体(例如 php composer.phar install 等),但是,我一直收到相同的错误.

I have tried other variations (such as php composer.phar install, etc..), however, I keep receiving the same error.

任何帮助将不胜感激.谢谢!

Any help would be much appreciated. Thank you!

推荐答案

确保 /usr/local/bin 在你的 $PATH

$ echo $PATH

然后执行

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
                                       ^^^^^^^^ you didn't rename it 

参考见

这篇关于尝试安装 composer 以设置 Laravel 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆