Wampserver not changing the PHP version for WEB (not CLI)

前端 未结 3 1882
忘掉有多难
忘掉有多难 2021-01-27 21:53

I have WampServer Version 3.1.4 64bit installed on Windows 7 and it comes with PHP versions php5.6.38, php7.0.32, php7.1.22, and php7.2.10. I would like to use php5.6.x rather t

相关标签:
3条回答
  • 2021-01-27 21:53

    (TL:DR) Use left click -(instead of right click)- menu to change PHP versions.

    (Long explanation) Hi, this happened to me today. I was trying to change the php version from 7.2 to 5.6 to test something. However, Wampserver was not changing the web version of php. After much searching in the web and noticing in certain videos that some people were getting a different menu than me in the wamp server icon, I realised that there is a whole left click menu in wampserver in which you can change the php version and it does change the web version of php.

    I understand that this can be a bit confusing for people who are used to using wampserver, but for someone who is using it for the first time, we are not used to having a left click menu in the bottom right icons. I hope this saves some time for others who have a similar issue than mine.

    0 讨论(0)
  • 2021-01-27 22:01

    I have faced kind of similar issue, I have installed wampserver upgrades from https://wampserver.aviatechno.net/?lang=en. I needed php 7.3 and 7.4, after installing the php upgrades, those new versions were not being reflected in wampserver traymenu (left click on wamp icon->php-versions). After spending quite some time looking into this, finally could fix this by following steps :

    Clearing logs (right click on wampserver icon -> tools -> empty logs) [my php log file was 300+ MB].

    Restarted wampserver and it was good to go.

    I found solution from this thread http://forum.wampserver.com/read.php?2,159184

    0 讨论(0)
  • 2021-01-27 22:06

    The wampmanager->Tools->Change PHP CLI Version menu only changes the version of PHP that will be used by wampmanager.exe to run all the PHP scripts that provide all the functionality of WAMPServer.

    It has no effect on the version of PHP that will will be run from the command line in Windows.

    If when you open a command windows and run the PHP interpreter >php.exe you actually get to the PHP interpreter, then you must have added one of the possible paths to one of WAMPServers PHP folders to the Window's PATH. You should never do this with WAMPServer, so if this is what you did, UNDO IT! This is for obvious reasons as you could have multiple versions of PHP available and want to run any one of them at any time as the CLI Version to test some code against multiple versions of PHP.

    Instead create yourself a little batch/cmd file that accepts a php version as a parameter like in this answer I posted a while ago

    With that you can set the PATH temporarily for the life of a command window ONLY. You can also make it include a PATH to the PEAR and/or COMPOSER folders at the same time, if you use either of these.

    To check All VC Runtimes

    There is a tool for checking if you have all the possible required VC Runtimes installed. Go to this page, the backup repo for WAMPServer, and download the little utility called Checks VC++ packages installed you will find it down near the bottom of the page. Download and run it, then throw it away, as it changes over time as new VC Runtimes become required.

    0 讨论(0)
提交回复
热议问题