[Tutorial] How to add another PHP version (PHP 7.4) - Updated
I got this error when changing the PHP version:
PHP Startup: Unable to load dynamic library 'curl' (tried: C:/laragon/bin/php/php-7.3.5-Win32-VC15-x64/ext\curl (The specified module could not be found.), C:/laragon/bin/php/php-7.3.5-Win32-VC15-x64/ext\php_curl.dll (The specified procedure could not be found.)) in Unknown on line 0
the solution: first turn off the server then change PHP version then start it up.
I wanted to run PHP 5.6, and had to figure out a couple things I thought I'd share.
First, the 5.6 or older releases aren't located on https://windows.php.net/downloads/releases/. You need to go to the "archives" subfolder to find them (ie https://windows.php.net/downloads/releases/archive).
Next, I scanned through to find the latest micro-release of 5.6- which I saw was 5.6.40. There were 5 versions of it:
I assume I didn't want the "source" version ("src") because that's probably going to be bigger and I'm not interesting in seeing how it was written, I just want to use it.
Next, based on @leokhoa's original description, because I have a 64-bit machine (does anyone use 32-bit machines nowadays?) I wanted one of the zips ending in "-x64.zip".
So that left two options: the one with "-nts-" in it, or not. I'm using Nginx for my webserver instead of a multi-threaded Apache, so I could use the more efficient NTS version.
So I downloaded " php-5.6.40-nts-Win32-VC11-x64.zip", put it in laragon's bin/php folder, extracted it there, and then chose that version from Laragon's menu. Except when I tried to load a page with Laragon, it hang for a few minutes, and then gave me some error message... something more was needed...
If something's wrong, please check and install correspond VC Redist (VC11, VC14, VC15...)
That took me a little while to figure out. The version of PHP I was trying to run had "VC11" in it, which stands for "Visual C++ 11". It seems "Visual C++" distributables are the files required to run programs made with "Visual Studio". Confusingly, "Visual Studio 2012" uses "Visual C++ 11" (it's like they released each new version of Visual C++ a year or so before the accompanying version of Visual Studio).
I found the link to download VC11 (aka "Visual Studio 2012 VC++ Redistributable") here, under "Redistributables and Build Tools".
After I downloaded that, and ran its installer, I could use PHP 5.6 with Laragon.
@mnelson4 : Many thanks for sharing this. It's very helpful.
Use this link to download php 7.3
I've tried to test PHP 7.4 Alpha 3 (php-7.4.0alpha3-Win32-vs16-x64). Since it was compiled with VS16, I have changed my Apache server to 2.4.39-win64-VS16
Unfortunately, I'm getting error: "Service Apache can not start. Reason: Unknown. Please check Apache log file".
But there is nothing in the log that would indicate any issue.
EDIT: I was sure that I had all the required VC16 files, but obviously not! After I reinstalled the Visual C++ Redistributable Packages for Visual Studio 2015-2019 x64:
it is working now!
I've do as you recommend, download last version of PHP (7.2.9), extract and it to PHP folder... as you can see :
After change PHP version, is still in v7.2.11... see:
$ php -v PHP 7.2.11 (cli) (built: Oct 10 2018 02:04:07) ( ZTS MSVC15 (Visual C++ 2017) x64 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
@wemersonrv : Did you switch to the version in Menu > PHP > Version?
Then close Terminal and try again.
Oh man! I just changed my PHP version to 7.3.3 and upon restart, all my local WordPress sites refuse to open with the same error:
Certificate key usage inadequate for attempted operation. Error code: SEC_ERROR_INADEQUATE_KEY_USAGE
Any help would be appreciated!
I found a way to install new versions of PHP in Laragon:
- Go to the folder
- Check Windows PHP Releases or Windows PHP Old Releases.
- Download the one that suits you, according to the section Which version do I choose?
on Windows PHP Web Site
- Extract the Zip at
- In Laragon, Menu > PHP > Version [<Current_PHP_Version>], select the previously downloaded version as following:
I hope this may have helped you...
- Go to the folder
"Error establishing a database connection"
I use Quick App Wordpress
plz help me
If you using redis After Changing php version you need to add redis extention.
- Download redis extention :
Or you can choose another version
Extract php_redis.dll to laragon\bin\php\php-7.4.5-Win32-vc15-x64\ext
Switch on extention: Laragon Menu > PHP > Extentions > redis
Hello, I followed the instructions above to update php 7.2 to 7.4.
Then I chose the new version of php in Menu> PHP> version 7.4.5.
I restarted the server.
My concern is that when I do php -v on the command line I always have the php 7.2 version which is taken into account, the same when I do a phpinfo ()!
How can I fix it?
@wemersonrv did you find a solution ?
I'm using Laragon v.4.0.16, and I have added php VC11 v.5.6.40, apache VC11; the problem is when I tried accessing the phpMyAdmin : this is the error message received :
Warning: Unknown: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\laragon\etc\apps\phpMyAdmin\index.php on line 9
Warning: Unsupported declare 'strict_types' in E:\laragon\etc\apps\phpMyAdmin\index.php on line 9
What should I do?se the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely mi
sspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in E:\laragon\etc\apps\phpMyAdmin\libraries\common.inc.php on line 33
Warning: Unsupported declare 'strict_types' in E:\laragon\etc\apps\phpMyAdmin\libraries\common.inc.php on line 33
PHP 7.1.3+ is required.
Currently installed version is: 5.6.40
For PHP version to show up correctly, let me ask are you using Composer?
I think if you use Laragon, and drop a new extracted folder into php folder it will work fine and it will use the new selected version.
But, in Windows, if say using composer, it will use the version that you selected or has a current path to.
If you re-run composer install, it should detect multiple versions and you can select the newest version and complete composer setup.
You might need to reboot Windows, but then when re-running PHP -v it should detect the latest version.
Currently I'm using laragon with default php version 5.6.40, but I have already another version of php 7.4 in the laragon; is it possible to directly specify which version of php to use for the webapp (customized php.ini for specific website)?
@leokhoa I updated PHP version 7.4 and switch version Menu > PHP > Version 7.4. But check php -v it PHP version 7.2 old
Hello, i've downloaded Laragon Portable, and then i've tried to update php (php-7.4.6-Win32-vc15-x64) but it don't work. The portable uses Nginx instead Apache. Anyone can help?
I use Composer and I did a composer install, and I'm still at version 7.2.19 doing php -v ... What is strange is that it shows me 7.2.19 only in the Visual Studio Code console, but when I use Cmder in the same folder, it shows me 7.4.5 - -'
Visual Studio Code :