Composer没有工作。

14 浏览
0 Comments

Composer没有工作。

我对Composer还不熟悉,正试图通过composer安装一个包,命令如下:

$ php composer require intervention/image

但是我遇到了一个错误,显示如下:

无法打开输入文件:composer

这个错误是因为我刚刚执行了上一个Composer命令,大约10分钟之前。

我不知道是什么原因导致了这个问题。

非常感谢任何帮助。

0
0 Comments

Composer is not working的问题出现的原因是在安装Composer时将其安装为全局的独立应用程序。解决方法是运行composer require intervention/image命令,而不是使用php composer require intervention/image命令。原作者之前习惯在composer命令前面添加php并且一直正常工作,不确定发生了什么变化。

0
0 Comments

Composer is a popular dependency management tool for PHP. However, sometimes users may encounter issues where Composer is not working properly. In this article, we will discuss the possible reasons for this problem and provide a solution.

One possible reason for Composer not working could be that it is not installed correctly. To resolve this issue, you can try the following steps:

1. Open your terminal window.

2. Execute the following command:

$ curl -sS https://getcomposer.org/installer | php

This command will download the Composer installer script and execute it using PHP.

3. Next, execute the following command to move the downloaded file to the appropriate location:

$ sudo mv composer.phar /usr/local/bin/composer

This command will move the Composer executable to the /usr/local/bin directory, which is commonly included in the system's PATH.

Once you have completed these steps, you should be able to use Composer by typing `composer` in the terminal, instead of `php composer ...`.

For more information and source of this solution, you can refer to this source.

By following these steps, you should be able to resolve the issue of Composer not working.

0