Ed Mozley
Ed Mozley

Reputation: 3549

vcruntime140.dll 14.0 not compatible with PHP build

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.

Upvotes: 95

Views: 207880

Answers (14)

Ed Mozley
Ed Mozley

Reputation: 3549

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

Upvotes: 177

Talib Hussain
Talib Hussain

Reputation: 1344

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.

Upvotes: 0

rachidFront Dev
rachidFront Dev

Reputation: 41

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.

Upvotes: 4

Miloslav Beňo
Miloslav Beňo

Reputation: 168

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.

Upvotes: 0

Feridun
Feridun

Reputation: 145

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

Upvotes: -2

aregahegn bekele
aregahegn bekele

Reputation: 81

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

Upvotes: 8

Jura Gorohovsky
Jura Gorohovsky

Reputation: 10148

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.

Upvotes: 10

Lwandile Rozani
Lwandile Rozani

Reputation: 49

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.

Upvotes: 2

saeed_m
saeed_m

Reputation: 175

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

Upvotes: 1

Sahabul Ashfari
Sahabul Ashfari

Reputation: 161

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

Upvotes: 16

manuxi
manuxi

Reputation: 352

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.

Upvotes: 1

Salman
Salman

Reputation: 61

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

Upvotes: 6

Nkeng Claud
Nkeng Claud

Reputation: 181

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

Upvotes: 18

Carlos Andrade
Carlos Andrade

Reputation: 181

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

Upvotes: 3

Related Questions