By default WAMPServer does nothing to associate a specific PHP CLI version.
So a command prompt should not know where/how to find php.exe
Internally it uses a version that comes with the install, so that we know the internal PHP code we test here will run there correctly.
I would guess that you have added one of the PHP version folders to your PATH.
You should NEVER add any PHP version folder to your PATH for this very reasonREMOVE any php version from your PATH, come to that NOTHING in WAMPServer requires adding to your PATH!
Instead create yourself a simple bat/cmd file like this, this is the one I use
Here's mine, I call it phppath.cmd
@echo off
REM **************************************************************
REM * PLACE This file in a folder that is already on your PATH
REM * Or just put it in your C:\Windows folder as that is on the
REM * Serch path by default
REM * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REM * EDIT THE NEXT 3 Parameters to fit your installed WAMPServer
REM **************************************************************
set baseWamp=D:\wamp
set defaultPHPver=5.6.15
set composerInstalled=%baseWamp%\composer
set phpFolder=\bin\php\php
if %1.==. (
set phpver=%baseWamp%%phpFolder%%defaultPHPver%
) else (
set phpver=%baseWamp%%phpFolder%%1
)
PATH=%PATH%;%phpver%
php -v
echo ---------------------------------------------------------------
REM IF PEAR IS INSTALLED IN THIS VERSION OF PHP
IF exist %phpver%\pear (
set PHP_PEAR_SYSCONF_DIR=D:\wamp\bin\php\php%phpver%
set PHP_PEAR_INSTALL_DIR=D:\wamp\bin\php\php%phpver%\pear
set PHP_PEAR_DOC_DIR=D:\wamp\bin\php\php%phpver%\docs
set PHP_PEAR_BIN_DIR=D:\wamp\bin\php\php%phpver%
set PHP_PEAR_DATA_DIR=D:\wamp\bin\php\php%phpver%\data
set PHP_PEAR_PHP_BIN=D:\wamp\bin\php\php%phpver%\php.exe
set PHP_PEAR_TEST_DIR=D:\wamp\bin\php\php%phpver%\tests
echo PEAR INCLUDED IN THIS CONFIG
echo ---------------------------------------------------------------
) else (
echo PEAR DOES NOT EXIST IN THIS VERSION OF php
echo ---------------------------------------------------------------
)
REM IF A GLOBAL COMPOSER EXISTS ADD THAT TOO
IF EXIST %composerInstalled% (
ECHO COMPOSER INCLUDED IN THIS CONFIG
echo ---------------------------------------------------------------
set COMPOSER_HOME=%baseWamp%\composer
set COMPOSER_CACHE_DIR=%baseWamp%\composer
PATH=%PATH%;%baseWamp%\composer
rem echo TO UPDATE COMPOSER do > composer self-update
echo ---------------------------------------------------------------
) else (
echo ---------------------------------------------------------------
echo COMPOSER IS NOT INSTALLED
echo ---------------------------------------------------------------
)
set baseWamp=
set defaultPHPver=
set composerInstalled=
set phpFolder=
You call it like this
C:> phppath
and it will use the default php Version
Or like this
C:> phppath 7.0.6
And it will use this Verison of PHP if it exists on your system in the WAMP folder.
This cmd file will add the correct things to your PATH, BUT ONLY FOR the duration of the command window. So to switch version of PHP either open another window and call this with a different parameter or close the windows you were using and open another and call `phppath` with another version of PHP as the parameter
---------------------------------------------------------------------------------------------
(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 --
phpMyAdminGet 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-
Edited 3 time(s). Last edit at 05/17/2016 01:02PM by RiggsFolly.