简体   繁体   中英

How to change php version in wamp?

I am using Wamp 3.2 on Windows 10. After I install, it shows it's running php 7.3.12 on the server. But the cli shows php 5.6.40. I firstly tried changing phpcli from 5.6.40 in wamp manager. I got the same result. I then tried changing the environment variable. There is still no change. My cli is still showing php 5.6.40. Unfortunately, this means I cannot run my frameworks such as Code Igniter 4.

Any help will be great. Thanks.

you need to change the version path in the Environment Variables of the system. Follow the steps.

  • This PC
  • Properties
  • Advanced system settings
  • Advance
  • click Environment Variables
  • Set path in system veriables as screenshot
  • then restart teminal

在此处输入图像描述

After changing the variables and all that, my main problem was cli kept on identifying php 5 as my php version. Even when I changed the phpcli version in Wamp manager, it kept on doing the same. And it is impossible to install wamp without php 5 for some reason.

What finally worked was going to the bin\php folder. I then inserted an underscore "_" infront of the folder name of php 5.

After that, cli started showing the php version specified in path variables. I have no idea why it works, but it does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM