问题
I just installed Wamp 3.1.3, and then installed composer.
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.
There is Wampserver path (c:/wamp64) into Windows PATH environnement variable: (C:\wamp64\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 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.
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.
Any workaround?
回答1:
Install the Composer manually:
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" %*
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.
No need to update the PATH
at all. Good luck.
来源:https://stackoverflow.com/questions/50385922/wamp-3-1-3-windows-environment-path-conflict