what's wrong with adding the WAMP's PHP to PATH?
Posted by: arvil (120.29.100.---)
Date: January 19, 2019 04:39PM

Hello,

I was always bothered by this Wamp message:


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.


I wish to use Wamp's PHP in cli, so I add it. But I do not understand if that WAMP notice is telling me there's a better way to do it? or is it something that we should avoid and use a different PHP executable that should be added to $PATH

Regards,

Options: ReplyQuote
Re: what's wrong with adding the WAMP's PHP to PATH?
Posted by: RiggsFolly (Moderator)
Date: January 19, 2019 05:28PM

The basic reason is that as WAMPServer can have multiple versions of PHP installed, you can use any of them from the CLI.

If you put ONE of the PHP versions on the PATH, when you want to use another version in a week/month/year from now, most people will forget that they put one on the PATH and then complain that they cannot use the version of PHP in the CLI that they want to.

So we suggest you do not put any version of PHP on the PATH.

I answered this on StackOverflow and provided a suggested bat file to use from the command line to temporarily add any version of PHP that may be installed in WAMPServer.
Please have a look at that

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: what's wrong with adding the WAMP's PHP to PATH?
Posted by: aleangelico (63.245.105.---)
Date: February 04, 2019 03:41PM

for many frameworks (Laravel for instance) you need to run command line tools constantly. I think your solution in StackOverflow could be implemented directly from WAMP. Every time the php version is changed from the wamp tool, just change the path. If this is not possible, then you can create and modify a "php" script in a folder in the path, so when running "php" this will run the script.

Example:

1. Add a folder d:\wamp64\scripts to the path
2. Change php version from WAMP tool
3. the change automatically modifies "php.cmd" with a line like:
D:\wamp64\bin\php\php7.2.10\php.exe


this way, everytime I change the php version, i have the right php in the command line.

Options: ReplyQuote
Re: what's wrong with adding the WAMP's PHP to PATH?
Posted by: RiggsFolly (Moderator)
Date: February 04, 2019 04:33PM

Hi,

But then you would not be able to sit at a command prompt and test a script against 3/4/5/6 different versions of PHP with a flick of the wrist smiling smiley

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: what's wrong with adding the WAMP's PHP to PATH?
Posted by: Otomatic (Moderator)
Date: February 05, 2019 09:09AM

Hi,

> Every time the php version is changed from the wamp tool, just change the path.
> If this is not possible, then you can create and modify a "php" script in a folder in the path,
> so when running "php" this will run the script.

I don't understand why the members of the "Coulda Shoulda Woulda" tribe haven't done it yet.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.