How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: »Ð@RK ÐR@GÖN™« (179.43.104.---)
Date: January 08, 2016 07:29PM

Hi to everybody!

Just wanna ask if there is any possibility to change the php version use in “CLI mode” in WampServer 2.5. Thus it come compile with php5.5.12. And I wanna delete this version, and replace the the version use in cli mode by php5.5.27; if this can be done without destroying the server.

If anyone knows how to do so, I´d like the procedures step by step

Best regards!

______________________________________________________________________
Powered By: JayManuel-NetWork4.org
©2015-2016 »Ð@RK ÐR@GÖN™«. All Rights Reserved.
______________________________________________________________________
WAMPServer 2.5 32bits
Apache2.4.18 | MySQL5.6.29 | php5.6.18-php5.5.32-php7.0.3
______________________________________________________________________



Edited 1 time(s). Last edit at 01/08/2016 07:33PM by »Ð@RK ÐR@GÖN™«.

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: Otomatic (Moderator)
Date: January 08, 2016 07:47PM

Hi,

I know how to suppress php version user in CLI mode.I'll give answer tomorrow morning. Now I use Smartphone and it is not simple to write long text. And I don't want to give wrong things.

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

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: »Ð@RK ÐR@GÖN™« (179.43.104.---)
Date: January 08, 2016 08:03PM

Hi Otomatic, how are you doing?

Thanks for your quick answer that was brief. I truly appreciate the good work you and RiggsFolly are doing it´s honorable…

I´ll be on await for the procedure

Best regards!

______________________________________________________________________
Powered By: JayManuel-NetWork4.org
©2015-2016 »Ð@RK ÐR@GÖN™«. All Rights Reserved.
______________________________________________________________________
WAMPServer 2.5 32bits
Apache2.4.18 | MySQL5.6.29 | php5.6.18-php5.5.32-php7.0.3
______________________________________________________________________

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: Otomatic (Moderator)
Date: January 09, 2016 10:42AM

Hi,

Regarding Wampserver 2.5, I suppose you added PHP 5.5.27 version "by hand," as there is no addon for this release.
So before you consider changing the CLI version, you must make sure it is functional, but not just by switching version by Wampmanager icon.
Indeed, when you change PHP version is only phpForApache.ini file of this new version that is used, while for the CLI it will php.ini.

- Launch Wampserver
- Swith PHP version used to 5.5.27
- Verify that there is no error
- Quit Wampserver

- Make sure that the PHP version you want to use as a CLI contents a php.ini file and that it contains the correct settings and paths.
--- Note: This can be a copy of phpForApache.ini file without loading xdebug.
- Edit wamp/wampmanager.conf file
- Replace:
phpCliVersion = 5.5.12
- By:
phpCliVersion = 5.5.27
- Save the modified file
- Launch Wampserver
- Verify that there is no error
- Quit Wampmanager
- Verify that in wamp/wampmanager.ini file there are :
--- everywhere wamp/bin/php/php5.5.27/php-win.exe and never wamp/bin/php/php5.5.12/php-win.exe
--- everywhere wamp/bin/php/php5.5.27/php.exe and never wamp/bin/php/php5.5.12/php.exe
--- that is to say that there is nowhere a mention of 5.5.12
Now, you may delete wamp/bin/php/php5.5.12/ folder.

Rename the file wamp\bin\php\DO_NOT_DELETE_5.5.12.txt into DO_NOT_DELETE_5.5.27.txt
Nota : This is done automaticaly with Wampserver 3

Subsidiary question: Why do not you use Wampserver 3.0.x ?

Aside: One might ask the question why there are two initialization files of PHP:
- phpForApache.ini for the version used with yours script
- php.ini only used for the CLI PHP version
PHP CLI is used only for internal scripts of Wampmanager and does not need extensions or settings you need for your own scripts. Also, if you perform manipulations or PHP extensions additions more or less risky and that it "crash" for your PHP scripts, it will have no effect on the CLI version of PHP.

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

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: »Ð@RK ÐR@GÖN™« (179.43.104.---)
Date: January 09, 2016 02:27PM

Hi Otomatic,
Thanks for your info about changing the Cli version, it´s really a privilege to acquire knowledge from those who have throd the road before and have the joy to share their experience.
I gladly would like to install WAMPServer 3.0 and it´s available updates, but, that won’t work for me; ’cause my OS is Windows Vista™ and MySQL5.7 does not support this version, and there are some other aspects that aren´t supported also…
I am grateful for your help and support in configuring WampServer

______________________________________________________________________
Powered By: JayManuel-NetWork4.org
©2015-2016 »Ð@RK ÐR@GÖN™«. All Rights Reserved.
______________________________________________________________________
WAMPServer 2.5 32bits
Apache2.4.18 | MySQL5.6.29 | php5.6.18-php5.5.32-php7.0.3
______________________________________________________________________



Edited 1 time(s). Last edit at 02/08/2016 04:55AM by »Ð@RK ÐR@GÖN™«.

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: January 09, 2016 02:48PM

Dr@gon,


If all you want to do is run some CLI scripts using a different version of PHP than is being used by the current selected Apache/PHP you have configured, its really easy.

Once you have to new version of PHP installed into WAMPServer, so its sitting there but not the currently selected version you can use a simple BATCH file like this from within a command window to select the PHP version you want to use inside this command window.

I use this all the time so I can quickly test code against multiple versions of PHP.


Here is my batch file, I call it

phpath.cmd


@echo off

REM **************************************************************
REM * PLACE This file in a folder that is already on your PATH
REM * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
REM * EDIT THE NEXT 2 Parameters to fit your installed WAMPServer
REM **************************************************************

set baseWamp=c:\wamp
set defaultPHPver=5.5.12

set phpFolder=\bin\php\php

if %1.==. (
    set phpver=%baseWamp%%phpFolder%%defaultPHPver%
) else (
    set phpver=%baseWamp%%phpFolder%%1
)

PATH=%PATH%;%phpver%
php -v


It has the default PHP version set in it i.e. 5.5.12 so if you call it like this

C:\>phppath
It will add PHP5.5.12 to your path and therefore when you do
C:\>php filename.php
It will run that php script with php5.5.12

But if you call it like this

C:\>phppath 5.5.27
It will add PHP5.5.27 to your path and therefore when you do
C:\>php filename.php
It will run that php script with php5.5.27


The only limitation is that you cannot change version inside the same command window, but you can run 2 or more command windows each running a different version of PHP

I hope this is what you were actually trying to do.

---------------------------------------------------------------------------------------------
(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: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: Otomatic (Moderator)
Date: January 09, 2016 06:10PM

Hi,

Quote
»Ð@RK ÐR@GÖN™«
I gladly would like to install WAMPServer 3.0 and it´s available updates, but, that won’t work for me; ’cause my OS is Windows Vista™ and MySQL5.7 does not support this version, and there are some other aspects that aren´t supported also…

Indeed, according to: MySQL supported platforms here MySQL versions supported by Windows :
Windows 10 x86, x86_64 : 5.7
Windows 8 x86, x86_64 : 5.7, 5.6, 5.5
Windows 2012 Server x86_64 : 5.7, 5.6, 5.5
Windows 7 x86, x86_64 : 5.7, 5.6, 5.5, 5.1
Windows 2008 Server R2 x86_64 : 5.7, 5.6, 5.5, 5.1
Windows Vista x86, x86_64 : 5.6, 5.5, 5.1, 5.0
Windows 2003 Server x86, x86_64 : 5.5, 5.1, 5.0
Windows XP x86, x86_64 : 5.5, 5.1, 5.0

When I wrote the installer for Wampserver 3.0.0 with MySQL 5.7.9, I gave as supported release: From Windows 6.0 (MinVersion = 6.0) that is to say Vista and I do not take a look at MySQL to see if MySQL 5.7 is supported by Vista.

I can write an installer Wampserver 3.0.0 with mysql 5.6.28 or an addon MySQL 5.6.28 if you want.

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

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: »Ð@RK ÐR@GÖN™« (179.43.104.---)
Date: January 09, 2016 10:22PM

Hi Otomatic, thank you for your support, but, for now I am gonna stay with the WampServer 2.5 and try to do my best personalizing my own configuration to fits my wants, this way I’ll learn some of the about of WAMPServer.

______________________________________________________________________
Powered By: JayManuel-NetWork4.org
©2015-2016 »Ð@RK ÐR@GÖN™«. All Rights Reserved.
______________________________________________________________________
WAMPServer 2.5 32bits
Apache2.4.18 | MySQL5.6.29 | php5.6.18-php5.5.32-php7.0.3
______________________________________________________________________



Edited 2 time(s). Last edit at 02/08/2016 04:58AM by »Ð@RK ÐR@GÖN™«.

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: pkachhia (117.239.215.---)
Date: September 20, 2017 08:34AM

Hi Otomatic,

I have two php versions installed in my wamp 2.4 with apache 2.4.4. PHP versions are 5.4.16 and 7.1.9, in wamp I can easily switch the versions but in CLI it always shows 5.4.16.

I have tried to implement both ways, updated wampmanager.conf file and make a batch file and run it, then also it always shows 5.4.16 in CLI.

Actually I want to install latest laravel using composer but because of older version in CLI I am not able to install it. To install it I have require to use PHP 7.1.9 in CLI.

So, can you help me to get rid of this?

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: Otomatic (Moderator)
Date: September 20, 2017 09:15AM

Hi,

Wampserver 2.4 is too old and no more supported.

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

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: pkachhia (117.239.215.---)
Date: September 20, 2017 12:06PM

Thanks Otomatic for your reply.
So, you mean that, I have to upgrade my wamp first and then try this, right? But here I have some constraints so I can not upgrade it . In this case, can you help me?

Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: Otomatic (Moderator)
Date: September 20, 2017 02:38PM


Options: ReplyQuote
Re: How To Change the php Version use in Cli Mode WAMPServer 2.5
Posted by: pkachhia (117.239.215.---)
Date: September 21, 2017 08:29AM

Thanks Otomatic for your reply,
I have solved my issue by uninstall composer and reinstall it. During installation it asks for select php version for CLI and I have selected 7.1.9 and it's done. Then I have installed laravel successfully.


Thanks again for your kind support.

Options: ReplyQuote


Sorry, only registered users may post in this forum.