不能打开输入文件:合成。phar ?

时间:2022-10-09 17:36:19

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

我正在尝试使用composer工具在wamp服务器上安装zendframework。

The following steps are done towards installation

安装步骤如下

  1. I downloaded the Composer-Setup.exe file from composer page and got successfully installed.

    我下载了Composer-Setup。exe文件从composer页面,并成功安装。

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

    我下载了zendframework,并在c:\wamp\ zend文件夹中提取。

  3. I executed the command for self update

    我执行了self update命令

    php composer.phar self-update

    php的作曲家。phar的由来

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

这一行生成了错误消息:无法打开文件composer.phar

how to resolve this error

如何解决这个错误?

If I try the

如果我试试

composer.phar self-update

不能打开输入文件:合成。phar ?

9 个解决方案

#1


36  

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

这将把composer安装到当前目录中,这样您就可以使用php composition .phar了

#2


29  

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

作曲家。phar安装不工作,但是没有。phar这工作。

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

在安装zendframe工作之前,我们需要在php中启用openssl模块。

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

我们必须取消注释;extension=php_openssl。dll从php。ini文件。

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

作曲家使用不同的php。ini文件,位于wamp\bin\php\php- <版本号> \php.ini

After enabling the openssl we need to restart the server.

启用openssl后,我们需要重新启动服务器。

The execute the following comments.

执行以下注释。

I can install successfully using these commands -

我可以安装成功使用这些命令-

composer self-update
composer install --prefer-dist

不能打开输入文件:合成。phar ?

#3


22  

I was trying to install YII 2.0

我试图安装YII 2.0。

php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

I got the same error:

我得到了同样的错误:

Could not open input file: composer.phar

不能打开输入文件:合成。phar ?

Then i gave the full path of .phar like this:

然后我给出了。phar的完整路径:

php C:\ProgramData\Composer\bin\composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

and it worked.

它工作。

#4


7  

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

我正在使用Windows 7,我在使用Composer时遇到了和你一样的问题。

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


3  

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

最初,我是运行php编写器的。phar自更新并得到相同的错误消息。

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

作为解决方案,应该在安装之后直接使用composer命令。从命令提示符中,只需输入composer,然后按enter。

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

如果composer被正确安装,那么你应该能看到很多来自composer的建议和命令列表。

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

如果您达到了这一点,那么您应该能够直接运行composer self-update。

#6


3  

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.

第一步:不要使用php编写器。phar [parameters]如果对您不起作用,只需使用composer [parameters],然后尝试其他的。希望它可以帮助。

#7


3  

Question already answered by the OP, but I am posting this answer for anyone having similar problem, retting to

OP已经回答了这个问题,但是我将这个答案发布给有类似问题的人

Could not input open file: composer.phar

无法输入打开文件: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:

假设这是您的web应用程序:

/Library/WebServer/Documents/zendframework

change directory to it, and then run composer update.

将目录更改为它,然后运行composer更新。

#8


1  

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

不要使用php的作曲家。phar自我更新首先进入项目目录使用composer。phar自我更新对我很有效

#9


1  

This is how it worked for me:

这就是它对我的作用:

  • Make sure composer is installed without no errors.

    请确保安装了composer,没有错误。

  • 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`

    打开windows上的“系统属性”,进入“高级”选项卡。(你只需按下键盘上的windows按钮,输入“编辑系统环境变量”

  • "Environment variables"

    “环境变量”

  • Under "System variables" Edit "PATH"

    “系统变量”编辑“路径”

  • Click on "New".

    点击“新”。

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

    类型:C:\ ProgramData \ ComposerSetup \ bin \ composer.phar

  • Close all folders & CMDs + restart you WAMP server.

    关闭所有文件夹& CMDs +重新启动WAMP服务器。

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

    进入您想要安装包的任何目录并输入

    composer.phar create-project slim/slim-skeleton

    作曲家。phar创建项目苗条/ slim-skeleton

for example.

为例。

#1


36  

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

这将把composer安装到当前目录中,这样您就可以使用php composition .phar了

#2


29  

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

作曲家。phar安装不工作,但是没有。phar这工作。

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

在安装zendframe工作之前,我们需要在php中启用openssl模块。

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

我们必须取消注释;extension=php_openssl。dll从php。ini文件。

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

作曲家使用不同的php。ini文件,位于wamp\bin\php\php- <版本号> \php.ini

After enabling the openssl we need to restart the server.

启用openssl后,我们需要重新启动服务器。

The execute the following comments.

执行以下注释。

I can install successfully using these commands -

我可以安装成功使用这些命令-

composer self-update
composer install --prefer-dist

不能打开输入文件:合成。phar ?

#3


22  

I was trying to install YII 2.0

我试图安装YII 2.0。

php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

I got the same error:

我得到了同样的错误:

Could not open input file: composer.phar

不能打开输入文件:合成。phar ?

Then i gave the full path of .phar like this:

然后我给出了。phar的完整路径:

php C:\ProgramData\Composer\bin\composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

and it worked.

它工作。

#4


7  

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

我正在使用Windows 7,我在使用Composer时遇到了和你一样的问题。

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


3  

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

最初,我是运行php编写器的。phar自更新并得到相同的错误消息。

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

作为解决方案,应该在安装之后直接使用composer命令。从命令提示符中,只需输入composer,然后按enter。

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

如果composer被正确安装,那么你应该能看到很多来自composer的建议和命令列表。

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

如果您达到了这一点,那么您应该能够直接运行composer self-update。

#6


3  

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.

第一步:不要使用php编写器。phar [parameters]如果对您不起作用,只需使用composer [parameters],然后尝试其他的。希望它可以帮助。

#7


3  

Question already answered by the OP, but I am posting this answer for anyone having similar problem, retting to

OP已经回答了这个问题,但是我将这个答案发布给有类似问题的人

Could not input open file: composer.phar

无法输入打开文件: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:

假设这是您的web应用程序:

/Library/WebServer/Documents/zendframework

change directory to it, and then run composer update.

将目录更改为它,然后运行composer更新。

#8


1  

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

不要使用php的作曲家。phar自我更新首先进入项目目录使用composer。phar自我更新对我很有效

#9


1  

This is how it worked for me:

这就是它对我的作用:

  • Make sure composer is installed without no errors.

    请确保安装了composer,没有错误。

  • 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`

    打开windows上的“系统属性”,进入“高级”选项卡。(你只需按下键盘上的windows按钮,输入“编辑系统环境变量”

  • "Environment variables"

    “环境变量”

  • Under "System variables" Edit "PATH"

    “系统变量”编辑“路径”

  • Click on "New".

    点击“新”。

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

    类型:C:\ ProgramData \ ComposerSetup \ bin \ composer.phar

  • Close all folders & CMDs + restart you WAMP server.

    关闭所有文件夹& CMDs +重新启动WAMP服务器。

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

    进入您想要安装包的任何目录并输入

    composer.phar create-project slim/slim-skeleton

    作曲家。phar创建项目苗条/ slim-skeleton

for example.

为例。