简体   繁体   English

通过composer进行yii2安装-无法打开输入文件:composer.phar

[英]yii2 installation via composer - Could not open input file: composer.phar

I am trying to install the yii2 and after I installed the composer I tried to run composer.phar global require "fxp/composer-asset-plugin:~1.1.1" it says : 我正在尝试安装yii2并且在安装了作曲家之后,我尝试运行composer.phar global require "fxp/composer-asset-plugin:~1.1.1"它说:

Could not open input file: composer.phar 无法打开输入文件:composer.phar

Any suggestions ? 有什么建议么 ?

Make sure of composer work correctly. 确保作曲家正常工作。

php composer.phar -v

Try 尝试

php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"

I know probably you've figured it out by now but still I want to help. 我知道您可能现在已经解决了,但仍然想提供帮助。 Make your composer.phar global so you can access it from anywhere. 将您的composer.phar全局化,以便您可以从任何地方访问它。 You can set path in environment variables or you can give direct path like below: 您可以在环境变量中设置路径,也可以给出如下所示的直接路径:

php C:\ProgramData\ComposerSetup\bin\composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic

Note : I'm using Windows 8.1 and composer is installed in C directory. 注意 :我使用的是Windows 8.1,并且composer安装在C目录中。

First of all install composer in your system Like windows system. 首先在您的系统中安装composer就像Windows系统一样。 you can download composer from this url https://getcomposer.org/download/ . 您可以从此URL https://getcomposer.org/download/下载作曲家。 after install composer you can go to C:\\composer check files for composer.phar and composer.bat files then copy both files and goto C:\\xampp\\php paste both files here and restart xampp then after that you can install yii2 安装composer之后,您可以转到C:\\ composer检查文件中的composer.phar和composer.bat文件,然后复制两个文件并转到C:\\ xampp \\ php将两个文件粘贴到此处并重新启动xampp,然后安装yii2 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM