Wamp 3.1.3 Windows环境PATH冲突 [英] Wamp 3.1.3 Windows Environment PATH conflict

查看:179
本文介绍了Wamp 3.1.3 Windows环境PATH冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Wamp 3.1.3,然后安装了作曲家。

I just installed Wamp 3.1.3, and then installed composer.

作曲家将php.exe的路径添加到Windows环境变量中。但是现在Wamp在上下文菜单中显示错误,即单击该错误将显示以下消息:

The composer added the path to php.exe to windows environment variables. But now Wamp shows error in context menu , that when clicked shows this message:


有错误。

There is an error.

在Windows PATH环境变量中有Wampserver路径(c:/ wamp64)
:(C:\wamp64\bin\php\php7.2.4)

There is Wampserver path (c:/wamp64) into Windows PATH environnement variable: (C:\wamp64\bin\php\php7.2.4)

似乎在环境变量PATH
C:PHPwamp64\bin\php\php7.2.4

It seems that a PHP installation is declared in the environment variable PATH C:\wamp64\bin\php\php7.2.4

Wampserver不使用,修改或不需要PATH环境变量。
在Wampserver或PHP版本上使用PATH
不利于Wampserver的正常运行。

Wampserver does not use, modify or require the PATH environment variable. Using a PATH on Wampserver or PHP version is detrimental to the proper functioning of Wampserver.

现在,如果我删除了路径,wamp很高兴,但是作曲家会抱怨php无法识别程序,否则作曲家会工作,但wamp会抱怨要删除路径。

Now if I remove the path, wamp is happy, but composer would complain that php is not recognized program, and otherwise composer works but wamp complains to remove the path.

有什么解决方法吗?

推荐答案

安装Composer 手动

Install the Composer manually:

创建名为 composer.bat 的蝙蝠脚本在 PATH 内的任何目录中,因此它在系统范围内包含:

Create bat script called composer.bat inside any directory within the PATH so it's system wide containing:

@C:\your\absolute\path\to\php.exe "%~dp0composer.phar" %*

下次更改PHP时,只需更新路径即可。或者,您可以有多个脚本,例如 composer-php6 composer-php7 等。调用多个php
版本。只需记住将 composer.phar 放在批处理脚本中即可。

Next time you change PHP simply update the path. Or you can have multiple scripts like composer-php6, composer-php7 etc. calling multiple php versions. Just remember to put the composer.phar alongside your batch script.

无需更新 PATH 。祝你好运。

这篇关于Wamp 3.1.3 Windows环境PATH冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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