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.
13
Answers
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
Install a compatible version through this link
https://support.microsoft.com/pt-br/help/2977003/the-latest-supported-visual-c-downloads
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: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
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
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.
if you are using xampp, go to apache folder C:/xampp/apache/bin… rename the vcruntime140.dll to vcruntime140.dll,old
hope it works..
if you are using xampp
method 1 : download vcruntime14.dll file from (http://www.dll-files.com)
replace the downloaded file in Xammppapachebin
method 2: if you have visual studio 2015 or above installed on you system
goto windowssystem32 and search for vcruntime14.dll and copy that file and replace it with vcruntime14.dll exists in Xammppapachebin
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:xamppphp and paste it directly to your C: drive.
The best method is to update XAMPP.
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
download and run exe from the bellow link.
https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170
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.
hello there i found nice soulution for this without install vc-redist perfect for win7
you need first to go to
C:WindowsSystem32
search forvcruntime140.dll
rename itvcruntime140_backup.dll
second thing is go to xampp path for example
C:xamppmysqlbin
search for the same filevcruntime140.dll
copy & paste intoC:WindowsSystem32
Congratulation.