PHP Version Issues
Posted by: chome4 (---.19-2.cable.virginm.net)
Date: July 31, 2020 04:08PM

I have the latest Wamp installed and localhost says I have PHP 7.3.12 but at the command prompt (cmd) I type 'php -ver', I get PHP 5.6.40. I am installing Composer and get the message:

The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.
Upgrade your PHP (5.6.40) to use this location with Composer.

When I type 'composer' at the command prompt, all is OK.


Following a php/mysql tutorial on youtube, I am setting up swiftmailer, and following instructions, I get

[RuntimeException]
No composer.json present in the current directory, this may be the cause of the following exception.



[InvalidArgumentException]
Package swiftmailer/swiftmailer at version ^6.0 has a PHP requirement incompatible with your PHP version (5.6.40)

The second error message is the one I'm concerned with for now.

How can I change this version of PHP to the latest?

Changing environment variables doesn't change things, either!



Edited 2 time(s). Last edit at 07/31/2020 05:38PM by RiggsFolly.

Options: ReplyQuote
Re: PHP Version Issues
Posted by: chome4 (---.19-2.cable.virginm.net)
Date: July 31, 2020 04:27PM

Found a solution!

Right-click on the Wamp icon, tools, PHP CLI and change to the latest version AND delete version 5.



Edited 2 time(s). Last edit at 07/31/2020 05:39PM by RiggsFolly.

Options: ReplyQuote
Re: PHP Version Issues
Posted by: Otomatic (Moderator)
Date: July 31, 2020 05:08PM

Hi,

> AND delete version 5.
Why ?

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.4
Wampserver 3.2.3 64 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.4
PhPMyadmin 5.0.2 - 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 »



Edited 1 time(s). Last edit at 07/31/2020 05:32PM by RiggsFolly.

Options: ReplyQuote
Re: PHP Version Issues
Posted by: RiggsFolly (Moderator)
Date: July 31, 2020 05:38PM

Except that all the WAMP internal code is tested against that version of PHP5, which is why it is there and the file `C:\wamp64\bin\php\DO_NOT_DELETE_5.6.40.txt` EXISTS with a little message in it

PLEASE READ BEFORE STOMPING ABOUT WITH YOUR BRAIN IN NEUTRAL

Here is a suggestion of how to run one of ANY NUMBER of PHP Versions at any point in time from a command line. Remember in WAMPServer you could have 5-10-15 different versions of PHP installed to use for different reasons and different projects. Thats the BENEFIT of WAMPServer over other WAMP kits.

How To Run PHP From Windows Command Line in WAMPServer

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.0 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.19>

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-



Edited 1 time(s). Last edit at 07/31/2020 05:39PM by RiggsFolly.

Options: ReplyQuote


Sorry, only registered users may post in this forum.