vcruntime140.dll 14.0 not compatible with PHP build
Asked Answered
E

14

90

I have downloaded PHP 7.4.1 NTS vc15 x86 on a Windows Server 2016 machine. I have also downloaded and installed vc_redist.x86.exe.

When I try and run php-cgi from the command prompt I get the following error:

PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0

Any ideas on how to resolve this? I guess I could install an older version of PHP from the archives but this doesn't really address the problem.

Ezar answered 19/12, 2019 at 17:12 Comment(0)
E
170

Turns out PHP 7.4.x requires Microsoft Visual C++ Redistributable for Visual Studio 2019 which can be downloaded here under the heading Other Tools and Frameworks

Ezar answered 19/12, 2019 at 17:20 Comment(6)
This also broke my coworker's laragon after she update to 7.4. Thanks for sharing.Timmons
From 2015 to 2019: support.microsoft.com/en-us/help/2977003/…Rabideau
Solved my problem too. Thank you.Volplane
Weirdly, this solved my Error: Apache shutdown unexpectedly problem. I started getting the error after updating XAMPP, and I thought the problem was about ports, but guess not.Soosoochow
Important: Use the 64 Bit version if you have 64 Bit PHP - otherwise the x86 versionMake
Odd that PHP.exe 7.4.9 worked with VC Runtime 2015 I already had installed, but PHP-CLI.exe needed the 2019 runtime.Gilkey
Z
16

if you are using xampp, go to apache folder C:/xampp/apache/bin... rename the vcruntime140.dll to vcruntime140.dll,old hope it works..

Zoe answered 30/10, 2020 at 1:59 Comment(2)
This is the best Answer by far !! i have been running around like a maniac trying to fix this thing on Xampp for days, i literally tried every answer on this topic and got frustrated almost change my OS for this ....... thanks man You're the bestSwec
I installed latest compatible C++, restarted, but it didn't work. But when I did what you advised here, it worked. But what happened behind the scenes?Querulous
R
15

I had the same problem. After I downloaded the latest version of Microsoft Visual C++, I successfully solved this problem. You can download it here . https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Relegate answered 17/4, 2020 at 1:29 Comment(2)
Thanks, after installing them and do a restart everything is working.Plugboard
I had this issue when installing Local by flywheel, it failed silently in the background, this fix allowed me to get up and running with PHP8Hemangioma
H
10

If this issue occurs when trying to integrate Command Line Tools into JetBrains PhpStorm 2019.3.x, check out the current status of this PhpStorm issue, and if it's not fixed in the latest version, use the VC runtime copy workaround described here:

Ensure to install MS VC Redist 2017, which has new vcruntime140.dll file, then:

Manually update/replace vcruntime140.dll at C:\Users\UserName\AppData\Local\JetBrains\PhpStorm 2019.x\jbr\bin (if installed local), or C:\Program Files\JetBrains\PhpStorm 2019.x\jbr\bin directory.

Hampshire answered 5/3, 2020 at 9:54 Comment(0)
S
6

I have downloaded and installed vc_redist.x64.exe file from here: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads and It works for me. If you face the same error it will surely work for you

Sherise answered 27/12, 2021 at 17:7 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewBricker
D
5

Downloaded and installed vc_redist.x64.exe file from here: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads and It works fine

Detrusion answered 8/7, 2020 at 4:18 Comment(0)
B
3

Install a compatible version through this link https://support.microsoft.com/pt-br/help/2977003/the-latest-supported-visual-c-downloads

Bernadette answered 16/1, 2020 at 17:30 Comment(0)
E
3

hello there i found nice soulution for this without install vc-redist perfect for win7

PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0

you need first to go to C:\Windows\System32 search for vcruntime140.dll rename it vcruntime140_backup.dll second thing is go to xampp path for example C:\xampp\mysql\bin search for the same file vcruntime140.dll copy & paste into C:\Windows\System32

Congratulation.

Emblem answered 12/1, 2023 at 21:44 Comment(0)
J
2

When using XAMPP Server on Windows whilst using the Laravel Framework to create a website the console logged an error when running the server "vcruntime140.dll 14.0 not compatible with PHP build".

I found the top answer on this page and installed Microsoft Visual C++ Redistributable for Visual Studio 2019 and when I ran the server again it still retuned an error. I noticed from the error log that after the PHP update PHP was being read directly from the C drive.

If you are using XAMPP Server the easiest fix is to copy the PHP folder located at C:\xampp\php and paste it directly to your C:\ drive.

The best method is to update XAMPP.

Jsandye answered 27/5, 2021 at 10:48 Comment(0)
V
1

Since I kept getting this error although vcredist was newly installed, I checked the vcredist files themselves. It turned out that there was an orphan vcredist file in the apache/bin folder which caused the problem.

Vibrate answered 26/8, 2020 at 0:46 Comment(0)
F
1

if you are using xampp method 1 : download vcruntime14.dll file from (www.dll-files.com) replace the downloaded file in Xammpp\apache\bin

method 2: if you have visual studio 2015 or above installed on you system goto windows\system32 and search for vcruntime14.dll and copy that file and replace it with vcruntime14.dll exists in Xammpp\apache\bin

Ferrari answered 9/2, 2021 at 10:58 Comment(0)
H
0

PHP for Windows requires Microsoft C and C++ (MSVC) runtime libraries and VCRUNTIME140.dll is the main library. You have an older version than the current PHP version was built with. Update MSVC to the latest version and you will be fine.

I wrote more information about this to the blog https://blog.devsense.com/2022/fix-php-warning-vcruntime140.dll since I've been asked about this multiple times.

Hunley answered 1/11, 2022 at 14:18 Comment(0)
L
0

After xampp update you need to update your Microsoft Visual C++ Redistributable Version following are the links

https://aka.ms/vs/17/release/vc_redist.x86.exe

https://aka.ms/vs/17/release/vc_redist.x64.exe

install it, then your xampp will work like a charm.

Landowner answered 6/3 at 7:18 Comment(0)
L
-3

download and run exe from the bellow link. https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

Ladd answered 13/10, 2022 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.