PHP 101
  • Home
  • Deploy
  • How-to
  • Tutorial
No Result
View All Result
PHP 101
  • Home
  • Deploy
  • How-to
  • Tutorial
No Result
View All Result
PHP 101
No Result
View All Result
Home Tutorial

How to change Laragon PHP version on Windows

In-depth tutorial on how to switch Laragon PHP version on Windows.

September 21, 2022
Reading Time: 3 mins read
PHP101.Net - Tutorial - Change Laragon PHP version on Windows

PHP101.Net - Tutorial - Change Laragon PHP version on Windows

Share on FacebookShare on Twitter

Table of Contents

    • Why switching Laragon PHP version?
    • Changing Laragon PHP version: Step by step
    • 1. Download your preferred PHP version
    • 2. Extract downloaded PHP version to Laragon PHP folder
    • 3. Switch PHP version in Laragon
    • 4. Reload Laragon
    • 5. Verify that new PHP version works in Laragon

Why switching Laragon PHP version?

It is very common to change PHP version when developing PHP applications, as different projects will depend on different PHP versions to satisfy the compatibility of their dependencies. Some cases requiring the PHP version to be switched include:

  • The PHP platform you are working on requires a newer or old PHP version to run;
  • The current PHP version is outdated and contains security vulnerabilities;
  • You want to test new features on a different PHP version;

For PHP development on Windows with Laragon, knowing how to switch Laragon PHP version will be definitely helpful for your development. Fortunately, it is very easy to change Laragon PHP version, and this tutorial will guide you on how to do that.

Tutorial StartsChanging Laragon PHP version: Step by step

Below are step-by-step instructions on how to switch the current Laragon PHP version to another one.

*We assume that you already have Laragon running and working properly.

1. Download your preferred PHP version

Go to the official PHP.net Windows download page:

https://windows.php.net/download/

Here on this page, choose the PHP version number + thread support type you want to download.

  • For PHP version number, this page lists only the latest, stable PHP versions (at the time of this article, 7.4.30, 8.0.23 and 8.1.10). If you want to download older version (eg. PHP 5), head to the archive page containing all PHP versions:
    https://windows.php.net/downloads/releases/archives/
    You will see a lot of PHP versions and download types, either .msi as installation package or .zip for zipped package. For Laragon, it is recommended to download the .zip package.
  • For PHP thread support type, the recommended thread support type for Laragon is Non-thread-safe version, which has the name containing nts.

Example 1: with the latest PHP 8.1.10 version, simply click here to download the zip package:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Pick the latest PHP non-thread-safe zipped version

Example 2: with the old PHP 5.6.40 version, pick this zip package on the Archive page:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Pick the old PHP 5.6.40 version

2. Extract downloaded PHP version to Laragon PHP folder

Simply extract the download PHP version zipped package, and copy the whole folder to Laragon’s PHP folder – [Laragon installation path]\bin\php:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Copy extracted PHP version to Laragon’s bin\php\ folder

3. Switch PHP version in Laragon

Laragon has a very nice feature to quickly switch the PHP version just by using its system tray menu.

Right click on Laragon system tray icon, choose PHP > Version [current PHP version] > [The new PHP version you wanted to use]

For example, we are choosing the downloaded PHP 8.1.10 version:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Switch Laragon PHP version by system tray menu

Right after switching PHP version, a Laragon notification will appear to indicate that the PHP version has been switched:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Laragon PHP version switched notification

4. Reload Laragon

Open Laragon Control Panel, click Reload to reload Laragon’s Apache with the new PHP version:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
Reload Laragon Apache

5. Verify that new PHP version works in Laragon

You can verify the new PHP version by creating a PHP file (assuming phpinfo.php) with the content:

<?php 
phpinfo();

Open the file on your browser and recheck, the new PHP version is now loaded:

PHP101.Net - Tutorial - Change Laragon PHP version on Windows
New PHP version switched on Laragon

The tutorial is now over. It’s a very nice feature of Laragon to be able to quickly switch the PHP version, compared to XAMPP which we have to make several file adjustments as our Change XAMPP PHP version on Windows tutorial.

The only downside of this feature is you cannot run multiple different PHP versions at the same time on Laragon, but of course, there are other ways for that, which we will have another tutorial on a later time.

Tags: change laragon php versionlaragon on windowslaragon php changelaragon php versionphp version
Previous Post

Deploy a webserver with XAMPP on Windows for PHP development

Next Post

Deploy a webserver with Laragon on Windows for PHP development

Related Posts

PHP101.Net - Tutorial - Install ImageMagick on Windows

How to install ImageMagick on Windows

September 9, 2022
PHP101.net - Tutorial - Install Composer on Linux

How to install Composer on Linux

March 8, 2022
Next Post
PHP101.Net - Deploy - Webserver with Laragon on Windows for PHP development

Deploy a webserver with Laragon on Windows for PHP development

We deliver free and helpful resources for learning
and using PHP programming language.

About
Contact Us
Privacy Policy
Main Sections

Home
Deploy
How-to
Tutorial
You might be interested in...

How to get user IP address using PHP

How to set MySQL charset (or MariaDB) by PHP

How to install ImageMagick on Windows

How to copy files using PHP

Deploy a webserver with Laragon on Windows for PHP development

© 2022 PHP101.Net - Helpful PHP Tutorials, How-to, Tips and Tricks for everyone.

No Result
View All Result
  • Home
  • Deploy
  • How-to
  • Tutorial

© 2022 PHP101.Net - Helpful PHP Tutorials, How-to, Tips and Tricks for everyone. | Privacy Policy

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.