You can change php version of composer without uninstalling it, follow these steps :

  1. Search for system environment variables in cortana.
  2. Click on the button "Environment variables".
  3. Under "System variables" select path and click on edit, you will see one entry like this "C:\wamp\bin\php\php5.6.13".
  4. Just change this to the folder name of the php located at your wamp/bin/php7.1.9, here php7.1.9 is folder name.
  5. Replace php5.6.13 with bin7.1.9, it will look like these "C:\wamp\bin\php\php7.1.9", just click ok on all the boxes.
  6. You are done.
  7. To verify, first close all the cmd windows, than open cmd and type php -v, press enter and you should see php7.1.9.
  8. If you don't see change in php version than just restart your pc and run php -v again in cmd , it will work.
Answer from geeky on Stack Overflow
🌐
HelpSpot
support.helpspot.com › index.php
3.1. Upgrading PHP on Windows
In order to upgrade your PHP version, you will want to download the latest compatible version of PHP from the Windows PHP distribution site: http://windows.php.net/download/.
🌐
GitHub
github.com › composer › composer › issues › 6277
Change php version used by composer on windows · Issue #6277 · composer/composer
March 19, 2017 - You switched accounts on another tab or window. Reload to refresh your session. ... There was an error while loading. Please reload this page. ... I don't understand why my composer is using a 5.4.45 php version when i don't see such version on my computer, i use wamp with php 5.6.25 , in my environmemt variable i have the this version on top of the list of path value. Is there a want to change the version composer is using please ?
Author   crashbdx
🌐
Codementor
codementor.io › community › switch php version on windows with one command
Switch php version on windows with one command | Codementor
December 6, 2024 - ), to switch your php version you need to type setx current_php [your_target_php_location] /m where [your_target_php_location] is the absolute path to the php version you want or use one of your php versions your defined here like this setx ...
🌐
DEV Community
dev.to › tkouleris › multiple-php-version-on-windows-10-1a97
Multiple PHP version on Windows 10 - DEV Community
July 16, 2023 - e. Click new and add the path of your new PHP version. After that click, Move Up as many times you need so that path will be on top of the other PHP versions that you have. f. Click OK to close the window, and that's it.
🌐
LinkedIn
linkedin.com › pulse › running-multiple-versions-php-windows-celine-bowen-fesff
Running Multiple versions of PHP on Windows.
June 12, 2024 - Open a new command prompt and run PHP -v to check the current PHP version. It should display PHP 7.4. To switch to PHP 8.1, you can temporarily change the path within your command prompt session: set PATH=C:\xampp81\php;%PATH%
🌐
Brinkster
brinkster.com › KB › Article~KBA-01252-T6H7B9~Change-php-version-on-windows
Knowledgebase - Change php version on windows. Web Hosting by Brinkster
September 7, 2020 - KB Home / Support / Code Snippets / Change php version on windows · Change php version on windows · Changing php versions · We have php 5.6***, 7.0***, 7.1***,7.2*** 7.3, 7.4 and 8.0 available. You can switch between them by changing it within your web.config file.
Find elsewhere
🌐
DEV Community
dev.to › kansoldev › how-to-change-php-version-in-xampp-for-windows-4klb
How to change PHP version in XAMPP for Windows - DEV Community
October 26, 2023 - In this article, i would show you how i changed my PHP version from 7.4.15 to 8.0.19. ... If you don't know your current PHP version, you can use this link to check it. Download the PHP version you want to use, you can find the PHP version you want to download from PHP's download website for windows, but there is something you need to know before downloading any package, the download for a PHP version exists in 2 types - thread safe and non thread safe.
Top answer
1 of 3
2

Hi @XR220 ,

I suggest you install php manager in IIS. It can help you manage different versions of php and it is simpler to add new php than configure fastcgi manually. Download it from here.

Please download php from this link and choose the zip:

Please put all php folders in C:\Program Files (x86)\PHP for ease of management. (Web PI also install php in this folder)

  1. Click php manager to register new php version.
  2. Choose the php-cgi.exe of php 7.3.31 and OK.
  3. Click Change php version to check which version of php is using now.
  4. Then click Check php info and OK, it will output the version of php.

If it doesn't output php version correctly and show error that fastcgi exited unexpectedly, you can use command line to run php-cgi.exe. It will tell you why php run failed. When I tested php 7.3.31, it ran failed because VCRUNTIME140.dll is missing. If you have same issue, please download it from here. Choose the x64 or x86 according to your machine.


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

Best regards,
Bruce Zhang

2 of 3
0

Hi there, Our intranet sites webserver is curretly using PHP version 7.4.21 and I'm trying to update it to 8.4.12.

I've installed the new version in the web server and saved it in the same PHP folder where the older version was installed.

After that I opened up IIS manager > webserver > Fast CGI settings and created a new fastcgi application with new php version folder path.

Expanded sites and clicked on one of the intranet site

Selected Handler mapping and updated the .php file with new path

Saved and restarted the webserver but the website gives error 505 with the new version. If I change the fastcgi application back to the older version the site works again.

Can someone please help me or let me know if I'm missing anything or suggest something? Thanks!

🌐
PHP
php.net › manual › en › install.windows.php
PHP: Installation on Windows systems - Manual
MUCH faster than a reboot, and you can check your changes faster as a result with the old: <?php> phpinfo(); ?> in your page somewhere. I wish I could remember where I read this tip; it isn't anything I came up with... ... You can have multiple versions of PHP running on the same Apache server.
🌐
HostGator
hostgator.com › help › article › change-php-version-windows
How to Change the PHP Version on Windows
Log in to Plesk. Click Websites & Domains on the left-hand menu. On the right pane, click on the PHP icon. Select the PHP support (PHP version) checkbox, then choose your preferred PHP version from the dropdown menu. Click OK at the bottom of the page to save changes and go to the previous page.
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1185228 › web-app-php-change-version
Web App PHP Change version - Microsoft Q&A
February 28, 2023 - Under Stack Settings, click the drop-down menu under Minor version and select the PHP version you want (we recommend choosing the most recent version). Click Save. ... Changing the stack settings of your app will trigger a re-start of your ...
🌐
Bobcares
bobcares.com › blog › upgrade-php-on-windows
Upgrade PHP on Windows - Do it with ease
October 15, 2020 - 4. At the top-right of the Web Platform Installer, you can find a Search Window where you need to type “PHP”. 5. Then select the PHP version that you wish to install and click “Add” and “Install”. Also, ensure that you select the 64-bit or 32-bit, depending on the server environment. 6. Finally, now you have successfully upgraded the PHP installation. Then open the command prompt and enter the command · iisreset to apply the new settings or you can simply reboot the server to apply the changes.
🌐
GitHub
github.com › cretueusebiu › valet-windows › issues › 173
Switching php version in windows · Issue #173 · cretueusebiu/valet-windows
October 15, 2020 - cretueusebiu / valet-windows Public forked from laravel/valet · Notifications · You must be signed in to change notification settings · Fork 88 · Star 916 · New issueCopy link · New issueCopy link · Open · Open · Switching php version in windows#173 ·
Author   Peter2962
🌐
sebhastian
sebhastian.com › how-to-update-php
How to update PHP version | sebhastian
July 25, 2022 - You should have the latest PHP version printed on the terminal. When you use a Windows computer, you can download a PHP distribution from windows.php.net and install it manually on your computer.