PHP 7: Missing VCRUNTIME140.dll

PHP 7: Missing VCRUNTIME140.dll

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

The VCRUNTIME140.dll Dependency Crisis in PHP 7 on Windows

When executing php on a Windows command line, you might encounter a system dialog stating: "The program can't start because VCRUNTIME140.dll is missing from your computer." This error typically halts execution immediately, preventing the CLI from initializing. This issue is not unique to PHP; it is a common symptom when an application relies on the Visual C++ Redistributable Runtime libraries without them being present in the system environment.

In the context of PHP 7, specifically builds compiled with Visual Studio 2015 (VC14), this dependency becomes critical. The PHP binary itself is not self-contained; it links against specific versions of the Microsoft Visual C++ runtime. If these libraries are absent or corrupted, the Windows loader cannot map the required memory segments into the process space, resulting in a crash before any application logic runs.

The root cause often traces back to how the development environment was set up versus the production environment. A common scenario involves developers building PHP from source using the Visual Studio Developer Command Prompt while their web server or CLI is expected to run on a clean Windows installation. In such cases, the necessary redistributable packages are often overlooked during the initial OS setup or the server migration process.

Attempting to manually download and register a .dll file from an external source is a risky approach that can introduce security vulnerabilities or version mismatches. The correct resolution involves installing the official Microsoft Visual C++ Redistributable package. This action ensures that all necessary system libraries, including VCRUNTIME140.dll, are properly registered in the Windows System32 directory and accessible to all 32-bit and 64-bit applications.

For a PHP 7 build compiled with VC14 (such as the x64 Thread Safe version), the specific requirement is the Microsoft Visual C++ Redistributable for Visual Studio 2015. This package is distinct from earlier versions like VC11 or VC14-SP1. Installing the correct redistributable resolves the missing DLL error without requiring manual registry edits or file copying.

Installation and Verification

To resolve this issue, locate the official Microsoft download page for the Visual C++ Redistributable. You must choose the version that matches your PHP binary architecture:

  • x86 (32-bit): If your PHP binary is 32-bit, install vcredist_x86.exe.
  • x64 (64-bit): If you are running a 64-bit build (like the x64 Thread Safe version mentioned in the source material), install vcredist_x64.exe.

It is best practice to install both packages simultaneously. Even on a 32-bit system, installing the x64 redistributable can sometimes be beneficial if other mixed-architecture components are involved, though strictly speaking, a 32-bit binary only requires the x86 runtime. However, Microsoft's official guidance often recommends installing the latest compatible package to ensure all dependencies are covered.

Once the installer runs successfully, restart your terminal or command prompt. This step is crucial because it forces the process to reload the dynamic link libraries from memory. Run the following command again:

php -v

If the installation was successful, you should see the PHP version string without any pop-up error messages. The CLI will now load correctly, allowing execution of scripts and access to the phpinfo() page via a web server.

Understanding the Build Tools Context

This specific error highlights the importance of understanding the build tools used to compile your software. PHP 7 was released with support for multiple Visual C++ versions (VC11, VC14). The version you are using—compiled with VC14—requires the 2015 runtime. Older PHP versions or those compiled with different toolchains might depend on VC11 libraries instead.

If you are deploying a custom-compiled PHP binary in a production environment, ensure that the target server matches the build environment's requirements. Relying solely on the php executable without verifying its runtime dependencies is a common oversight. The presence of this DLL is mandatory for the execution engine to function; it contains essential C++ standard library functions that the PHP interpreter calls during startup.

Conclusion

Resolving the VCRUNTIME140.dll missing error requires installing the appropriate Microsoft Visual C++ Redistributable package corresponding to your PHP build's architecture and compiler version. Avoid downloading individual DLL files, as this bypasses security checks and registration protocols built into the Windows Installer framework. By following the official installation procedure and verifying the fix with a simple command line check, you can ensure a stable environment for running PHP 7 scripts.

Our network