could not open input composersetup.php,Could not open input file: composer.phar

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

I am trying to install zendframework using composer tool in wamp server.

The following steps are done towards installation I downloaded the Composer-Setup.exe file from composer page and got successfully installed.

I downloaded the zendframework and extracted inside the c:\wamp\www\zend folder

I executed the command for self update

php composer.phar self-update

This line generates the error message: could not open file composer.phar

how to resolve this error

If I try the composer.pharself-update

466751747c825d6cf45d35cf73498d07.png

回答1:

Use this : php-r"readfile('https://getcomposer.org/installer');"|php

This will install composer to the current directory so that you can use php composer.phar

回答2:

The composer.phar install is not working but without .phar this is working.

We need to enable the openssl module in php before installing the zendframe work.

We have to uncomment the line ;extension=php_openssl.dll from php.ini file.

composer use different php.ini file which is located at the wamp\bin\php\php-\php.ini

After enabling the openssl we need to restart the server.

The execute the following comments.

I can install successfully using these commands - composerself-update composer install--prefer-dist

1f93ee54d548625ef68a3ccaa9e81a95.png

回答3:

I was trying to install YII 2.0 php composer.phar create-project yiisoft/yii2-app-advanced advanced2.0.0-alpha

I got the same error:

Could not open input file: composer.phar

Then i gave the full path of .phar like this: php C:\ProgramData\Composer\bin\composer.phar create-project yiisoft/yii2-app-advanced advanced2.0.0-alpha

and it worked.

回答4:

I am using Windows 7, and I got the same problem as yours while using Composer via cmd.

The problem is solved when I use php C:\ProgramData\ComposerSetup\bin\composer.phar create-project slim/slim-skeleton

instead of php composer.phar create-project slim/slim-skeleton

Hope this is useful for people who got the same problem.

回答5:

Initially, I was running php composer.phar self-update and got the same error message.

As a resolve, you should use composer command directly after install it.From the command prompt, just type composer and press enter.

If composer is installed correctly then you should able to see a lot of suggestion and command list from composer.

If you are up to this point then you should able to run composer self-update directly.

回答6:

First try this: dont use the php composer.phar [parameters] simply use composer [parameters] if this doesn't work for you than try the rest. Hope it helps.

回答7:

Question already answered by the OP, but I am posting this answer for anyone having similar problem, retting to Could not input open file: composer.phar

error message.

Simply go to your project directory/folder and do a composer update

Assuming this is where you have your web application: /Library/WebServer/Documents/zendframework

change directory to it, and then run composer update.

回答8:

dont use php composer.phar self-update First go to Your project directory simply use composer.phar self-update This works for me

回答9:

This is how it worked for me: Make sure composer is installed without no errors.

Open "System Properties" on windows and go to the "Advanced" tab. (You can just press the windows button on your keyboard and type in "Edit the system environment variables`

"Environment variables"

Under "System variables" Edit "PATH"

Click on "New".

Type in: C:\ProgramData\ComposerSetup\bin\composer.phar

Close all folders & CMDs + restart you WAMP server.

Go to whatever directory you want to install a package in and type in

composer.phar create-project slim/slim-skeleton

for example.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值