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

前端 未结 3 1910
忘掉有多难
忘掉有多难 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 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.

提交回复
热议问题