DEV Community

Cover image for How to switch or update PHP version in Laragon
Muhamad Rizki
Muhamad Rizki

Posted on • Updated on

How to switch or update PHP version in Laragon

Laragon is a portable, isolated, fast & powerful universal development environment for PHP, Node.js, Python, Java, Go, Ruby. It is fast, lightweight, easy-to-use and easy-to-extend.

Unlike other development environments, in Laragon you can change the version of the programming language and database used in Laragon, which is what makes Laragon easy to use and extend.

However, Laragon no longer receives updates since it was last updated on September 16, 2022. And if you want to find out how to update the programming language or database used, it will be a little difficult because Laragon itself doesn't have any documentation about it.

How to switch or update PHP version

First of all, make sure you have Laragon installed on your Windows, you can download Laragon via this link laragon.org/download

Download PHP version for Windows

Search for the PHP version you want to install on Windows, you can find it via this link windows.php.net/download.
PHP For WindowsChoose according to the Windows architecture you are using (X64 or X86) and decide whether you want thread safety or non-thread safety, I recommend choosing thread safety.

Download the latest version of Apache

If you choose to update the PHP version to a higher version, don't forget to also update the version of Apache, I recommend downloading the latest version, you can download the latest version of Apache via this link apachelounge.com/download
Apachelounge

Extract your PHP and Apache to Laragon

If you have successfully downloaded your desired version of PHP and Apache, you can extract it into Laragon

Extract PHP into laragon > bin > php folder
PHP Path

Extract Apache into laragon > bin > apache folder
Apache Path

Edit the system environment variables

After you have successfully extracted it, don't forget to edit your system environment variables, you can type env in Windows search to open the menu.

In the system variables section, go to the path menu in the system environment variable and add the paths of PHP and Apache that you downloaded earlier.

System environment variables

Note: move it to the top of the PHP version you want to use, like in the picture where I want to use version 8.3 so I put it at the top.

Once done you can press the Ok button until the system environment variable menu closes, and you can check if the versions of your PHP and Apache have changed using the terminal.

Terminal Windows

Good, you have successfully changed it, don't forget to also set the PHP and Apache versions that you are using in Laragon.

Apache version

PHP version

You can exit Laragon to restart it after you have finished setting the versions of PHP and Apache. Good luck...

Top comments (0)