Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (94.142.12.---)
Date: April 08, 2018 12:08AM

Good day.
I have just uninstalled Wampserver 3.1.0 and installed Wampserver 3.1.3.
New Wamp itself is so far so good. Icon is green, MariaDB has no conflicts with MySQL, 3 services are running OK.
However, I had to remove PHP and MySQL from system Path Variable as Wampserver 3.1.3 has required.
What shall I do know with my Composer?
Windows command prompt doesn't know it anymore.
I also cannot refer either to php or mysql in cmd anymore and do not think it's a good idea.
Looking forward to appropriate advices.
Best Regards,
Mike

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: Otomatic (Moderator)
Date: April 08, 2018 09:30AM

Hi,

If you absolutely need the PHP and MySQL paths in the PATH environment variable, you can avoid the Wampserver alarm :
Right-Click wampmanager tray icon -> Wamp settings -> Do not verify PATH (to check it)

Using the PATH to launch applications is a survivorship of the past and it will cause you big problems if you change versions of PHP.

Note : This is only a warning from Wampserver that you can ignore.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
PhPMyAdmin 4.8.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (94.142.12.---)
Date: April 08, 2018 10:17AM

Thank you.
However as soon as I put paths to php and mysql\bin folders to system Path environment variable - green light becomes orange and I see "2 of 3 services running".
Somehow MariaDB and MySQL are conflicting and MySQL won.
I reinstalled Wampserver 3.1.3 anew and this time MariaDB won.
Most probably, if I disable MariaDB, - this will help to turn orange into green. - But I still belive that there is a different solution to have all 3 services running, about which I don't know yet.
Please help.
I really like Wampserver.

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: Otomatic (Moderator)
Date: April 08, 2018 11:55AM

Hi,

With my Wampserver 3.1.3 fresh install I put "j:\wamp\bin\mysql\mysql5.7.21\bin\" into PATH variable then restart Windows.
When I launch Wampserver Icon is green with error at the bottom sayning that there is j:\wamp\bin\mysql\mysql5.7.21\bin\ into PATH.

MySQL 5.7.21 use port 3306 and is default DBMS
MariasDB 10.2.14 use port 3307

See errors in Mariadb log.

When Mariadb is OK the last lines are:

2018-04-08 10:52:44 4068 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2018-04-08 10:52:44 4068 [Note] InnoDB: 5.7.21 started; log sequence number 1620520
2018-04-08 10:52:44 6644 [Note] InnoDB: Loading buffer pool(s) from j:\wamp\bin\mariadb\mariadb10.2.14\data\ib_buffer_pool
2018-04-08 10:52:44 4068 [Note] Plugin 'FEEDBACK' is disabled.
2018-04-08 10:52:44 6644 [Note] InnoDB: Buffer pool(s) load completed at 180408 11:52:44
2018-04-08 10:52:44 4068 [Note] Server socket created on IP: '::'.
2018-04-08 10:52:44 4068 [Note] Reading of all Master_info entries succeded
2018-04-08 10:52:44 4068 [Note] Added new Master_info '' to hash table
2018-04-08 10:52:44 4068 [Note] wampmariadb: ready for connections.
Version: '10.2.14-MariaDB' socket: '' port: 3307 mariadb.org binary distribution

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
PhPMyAdmin 4.8.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (94.142.12.---)
Date: April 08, 2018 01:01PM

Thank you.

One general result . IT ALL WORKS as you described the last time. And it's great!

Some peculiar details are as follows:

1) if I put "c:\wamp64\bin\mysql\mysql5.7.21\bin" into PATH variable and don't restart Win, - icon is orange

2) if I put "c:\wamp64\bin\mysql\mysql5.7.21\bin" into PATH variable and DO restart Win, - icon is green

3) if I put "c:\wamp64\bin\mysql\mysql5.7.21" into new MYSQL_HOME variable , then put "%MYSQL_HOME%\bin" into PATH variable and DO restart Win, - icon is orange

This is of course trivial, but nevermind. I can live with this smiling smiley

Thanks for help and great product,

Best regards,
Mike

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: Otomatic (Moderator)
Date: April 08, 2018 02:38PM

Hi,

The first point to consider is that for changes to environment variables to be taken into account by Windows, it is essential to perform a restart.

The second point to take into account is the search order of the php.ini and my.ini files which, in principle, first looks in the folders pointed to by the PATH variable before looking in the own folder of the current PHP or MySQL or MariaDB version.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
PhPMyAdmin 4.8.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (---.pppoe.avangarddsl.ru)
Date: April 08, 2018 06:27PM

Thanks for your precious replies.

After fresh install of Wampserver 3.1.3 - both PHP CLI and PHP web were 5.6.35

I made the following:

1) Left-Click - PHP - Version -> 7.2.4

2) put "C:\wamp64\bin\php\php7.2.4" into PATH variable

3) run in cmd "php --version" and get "PHP 7.2.4 (cli) ..."

Does it mean that I haven't got to do: Right-Click - Tools - Change PHP CLI version -> 7.2.4 ?

I am asking this since when I do Right-Click - Tools - I still see white text on grey background "PHP CLI = 5.6.35 - WEB = 7.2.4"

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: Otomatic (Moderator)
Date: April 08, 2018 06:57PM

Hi,

> I still see white text on grey background "PHP CLI = 5.6.35 - WEB = 7.2.4"
CLI 5.6.35 is used by Wampmanager PHP internal scripts.
That is seen by informations in wampmanager.conf file :
phpVersion = "7.2.4"
phpCliVersion ="5.6.35"

Without any reference to a path on a PHP version in the PATH environment variable, in a Windows command window:
php --version returns:
'php' is not recognized as an internal command
or external, an executable program or a command file.

On your system, it works without error since you created a path on PHP 7.2.4 in the PATH variable, so the php-version command returns the information from version 7.2.4, since it is the only one known to PATH.
> PHP 7.2.4 (cli)
And (cli) simply indicates that PHP is running from the command line and not that it is the CLI version of Wampserver.

On the other hand, if you always run the same command from a Windows command window, but with a full path, you will get information about the PHP version pointed to by the full path.

C:\Windows\system32>j:\wamp\bin\php\php7.1.16\php.exe --version
PHP 7.1.16 (cli) (built: Mar 28 2018 21:27:36) ( ZTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.6/7.1.18/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.7
PhPMyAdmin 4.8.0.1 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (---.pppoe.avangarddsl.ru)
Date: April 08, 2018 09:21PM

Thank you.

Now this is all sorted out for me.

In fact I need PHP in system PATH variable so that to use Composer in cmd.

And I need MySQL in system PATH variable so that to make convenient mass mysqldump while moving DBs during upgrade of Wampserver.

Best Regards,
Mike

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: RiggsFolly (Moderator)
Date: April 09, 2018 11:05AM

Mike,

No you dont, to both of those reasons.

All you need is a couple of simple .bat file placed in a folder that is ALREADY on your PATH

I call this one `phppath.cmd`
It looks after PATHing any of my PHP versions and COMPOSER and PEAR also if you want it BUT for only the duration of the life of a Command Window

@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 * for example I installed WAMPServer on the D: drive you may
REM * have used C:
REM * - baseWamp : is the drive and folder where you installed WAMPServer
REM * - defaultPHPver : is the version of PHP that will be pathed
REM *                   if no Parameter is put on the bat file
REM * - composerInstalled : Where I insatlled composerInstalled
REM * - phpFolder : The folder structure that contains the Multiple
REM *               possible version of PHP I have installed
REM **********************************************************************


set baseWamp=D:\wamp
set defaultPHPver=7.0.23
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 COMPOSER EXISTS ADD THAT TOO
REM **************************************************************
REM * IF A GLOBAL COMPOSER EXISTS ADD THAT TOO
REM *
REM * This assumes that composer is installed in /wamp/composer
REM *
REM **************************************************************
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=


I call this one `mysqlpath.cmd`
@echo off

set baseWamp=D:\wamp
set MySQLFolder=\bin\mysql\mysql
set defaultMySQLver=5.7.19

if %1.==. (
    set mysqlver=%baseWamp%%MySQLFolder%%defaultMySQLver%\bin
) else (
    set mysqlver=%baseWamp%%MySQLFolder%%1\bin
)


PATH=%PATH%;%mysqlver%
echo
echo -----------------------------------------------
mysql -V
echo -----------------------------------------------
echo

set baseWamp=
set MySQLFolder=
set defaultMySQLver=


You set them up to have the most likely default version set, then you can run them from any CMD prompt as

Uses default version
phppath 
mysqlpath

Uses a specific version
phppath 7.2.1
mysqlpath 5.7.22


And there you are.

There is absolutely NO NEED to add anything into the Windows PATH because that will ALWAYS just cause you issues later when you change versions of either PHP or MySQL

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

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 MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 2 time(s). Last edit at 04/09/2018 11:07AM by RiggsFolly.

Options: ReplyQuote
Re: Wampserver 3.1.3: how to explain to composer lack of PHP Path Variable
Posted by: baursak (---.pppoe.avangarddsl.ru)
Date: April 10, 2018 06:40AM

Thank you.

I have found already the post here
[forum.wampserver.com]

And done .cmd file for PHP.

After that I blended .cmd for MySQL. - But yours is of course authentic and I will use it.

Now neither PHP nor MySQL are there in my system PATH anymore.

Best Regards,
Mike

BTW, you have set of very useful instructions here

[wampserver.aviatechno.net]

These two .cmd files would absolutely relevant there to avoid questions like mine.

And also thank you for your check_vcredist utility. You are the only ones who respect MS Visual C++ already installed on client side and offer to install only those, which are absent.

Options: ReplyQuote


Sorry, only registered users may post in this forum.