The php7ts.dll errors you may see
Windows or the application may report:
- “The code execution cannot proceed because php7ts.dll was not found.”
- “php7ts.dll is missing from your computer.”
- “The program can’t start because php7ts.dll is missing from your computer.”
- “php7ts.dll is either not designed to run on Windows or it contains an error.”
- “The procedure entry point … could not be located in the dynamic link library php7ts.dll.”
Free tools Windows power users keep installed
One-click scans. No signup required.
A PHP-based program may instead show “Unable to load dynamic library” during startup. These messages can appear when launching Apache, XAMPP, WAMP, Laragon, a PHP command-line tool, or another application that bundles PHP.
The 60-second answer
php7ts.dll is the Thread Safe PHP 7 runtime DLL. It is not a Windows file and should not normally be present in C:WindowsSystem32 or C:WindowsSysWOW64.
Repair or reinstall the application or PHP distribution that originally supplied it. Use the same PHP minor version, architecture, and Thread Safe build. Do not download a loose copy from a DLL website.
If the message names VCRUNTIME140.dll, MSVCP140.dll, or another Microsoft runtime file, repair the matching Microsoft Visual C++ Redistributable instead. That runtime supplies PHP dependencies; it does not recreate php7ts.dll.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches#1 Best Overall
What php7ts.dll belongs to
The file is part of PHP for Windows, usually stored beside php.exe in a PHP directory. A bundled server may keep it inside an application folder rather than a standard Windows location.
The ts suffix means Thread Safe. Thread Safe PHP builds are commonly used when PHP is loaded directly as an Apache module. IIS FastCGI installations normally use Non-Thread Safe, or NTS, builds instead.
The PHP Windows packages distinguish several details that must match:
| Component | Must match |
|---|---|
| Architecture | x86 with x86, or x64 with x64 |
| Thread model | TS with TS extensions and server configuration |
| PHP version | The same PHP minor branch and compatible build |
| Microsoft runtime | The runtime architecture required by PHP |
| Application path | The directory actually used by Apache, the launcher, or PATH |
A 64-bit version of Windows can run a 32-bit PHP application. Choose based on the PHP package or application, not simply on whether Windows is 64-bit.
Find the program that installed it
Before replacing anything, identify which PHP installation is failing.
Check PHP from Command Prompt
- Press Start.
- Type Command Prompt.
- Open it.
- Run:
where php
If more than one path appears, Windows has multiple PHP installations in PATH. The first result is normally used when you type php.
Now check the selected installation:
php.exe -v
php.exe --ini
The version output can show whether the build is Thread Safe or Non-Thread Safe, along with its architecture. The --ini command shows which php.ini is being read.
If where php returns no result, the application may use its own private PHP directory. Look in the application’s installation folder, or inspect its launcher and Apache configuration.
Rank #2
Check whether the file is actually present
From the suspected PHP directory, run:
dir /a "C:pathtophpphp7ts.dll"
Replace the example path with the real directory.
- If the file exists, the problem may be a missing dependency, wrong architecture, or a conflicting PHP copy.
- If it is absent, repair the complete application or PHP package rather than copying a replacement from elsewhere.
For Apache, inspect httpd.conf and find the configured PHP module path and PHP directory. Apache may be loading a different installation from the one you checked at the command line.
Fix 1: Repair or reinstall the owning application
This is the safest and most likely fix when the file disappeared after an update, failed extraction, cleanup, antivirus quarantine, or moving the application folder.
For a bundled application
- Close the application, Apache, PHP terminals, and related launchers.
- Open Settings.
- Select Apps and then Installed apps.
- Find the PHP-based application, server package, or development environment.
- Select the three-dot menu.
- Choose Advanced options, if available.
- Select Repair or Reset, depending on what the application provides.
- Start the application again.
If there is no repair option:
- Download the application again from its developer’s official installer source.
- Uninstall the existing copy only after backing up its projects, configuration, and databases.
- Restart Windows.
- Install the same application again.
- Restore your projects and configuration carefully.
- Test the bundled PHP before adding extensions or custom settings.
For standalone PHP, obtain the complete matching archive from the official PHP for Windows release archive. Extract the entire package into the expected directory. Do not combine php7ts.dll from one release with extensions or executables from another.
Check antivirus quarantine
If the file existed previously:
- Open Windows Security.
- Select Virus & threat protection.
- Choose Protection history.
- Look for a detection involving the application’s PHP directory.
- Confirm that the file came from the official application or PHP package.
- Do not restore it blindly. If the origin is uncertain, reinstall the complete package instead.
- If your security product confirms the package is safe, follow its restore process and test the application.
Do not create a permanent antivirus exclusion merely to make the error disappear.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchA successful repair restores the original PHP directory structure and allows the same launcher, Apache service, or PHP command to start without a DLL error.
Fix 2: Match x86, x64, TS, and NTS
A file can be present and still fail because the surrounding PHP build does not match it.
Use these combinations:
- 32-bit PHP with 32-bit PHP extensions and the x86 Visual C++ runtime.
- 64-bit PHP with 64-bit PHP extensions and the x64 Visual C++ runtime.
- Thread Safe PHP with Thread Safe extensions.
- Non-Thread Safe PHP with Non-Thread Safe extensions.
- PHP 7.2 extensions with the compatible PHP 7.2 build, not an older or newer branch.
Check the PHP build:
php.exe -v
Then check the executable Windows resolves:
where php
If the wrong path appears first, remove the obsolete PHP directory from PATH or move the intended directory earlier in the list:
- Press Start and search for environment variables.
- Select Edit the system environment variables.
- Select Environment Variables.
- Edit the relevant
Pathentry under User variables or System variables. - Remove stale PHP paths or move the correct one above them.
- Select OK on every dialog.
- Open a new Command Prompt and run
where phpagain.
For Apache, update the PHP module and directory settings in httpd.conf, then restart Apache. Confirm that Apache and the command line are not using different PHP installations unintentionally.
An entry-point error or “not designed to run on Windows” message usually indicates a mismatch rather than a simple missing file.
Fix 3: Repair the Microsoft Visual C++ runtime
Use this fix when the error identifies VCRUNTIME140.dll, MSVCP140.dll, or another Visual C++ component.
- Open Microsoft’s official Visual C++ Redistributable downloads page.
- Download the architecture that matches PHP.
- Install x86 for a 32-bit PHP build, even on 64-bit Windows.
- Install x64 for a 64-bit PHP build.
- Run the installer.
- Choose Repair if it is already installed, or complete the installation if it is missing.
- Restart Windows.
- Test PHP again with:
php.exe -v
The modern v14 runtime supports applications built with the relevant Visual Studio 2015–2022 compiler family. Several Visual C++ Redistributable versions can coexist, so do not remove unrelated versions without a separate reason.
Installing Visual C++ will not restore a missing php7ts.dll. It only repairs a dependency that PHP may need in order to load.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Fix 4: Disable an incompatible PHP extension
An extension added after the PHP installation can cause startup warnings or entry-point failures.
- Run:
php.exe --ini
- Open the reported
php.inifile in a text editor. - Look for recently added
extension=lines. - Add a semicolon at the beginning of a suspect line, for example:
;extension=example.dll
- Save the file.
- Run:
php.exe -v
- If PHP starts, install an extension built for the exact PHP version, architecture, and TS/NTS mode.
Also inspect the extension directory configured by extension_dir. Remove stale extension files from older PHP installations only after confirming which directory the current PHP build uses.
If the error began after changing php.ini, an extension is a stronger suspect than the PHP core file itself.
Fix 5: Reinstall after a failed extraction or update
A partially extracted archive can leave php7ts.dll absent while other files appear normal.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #4
- Close all PHP and Apache processes.
- Delete or rename the incomplete PHP directory after backing up configuration and project files.
- Download the complete package from the official PHP Windows archive.
- Extract it with a reliable archive utility.
- Preserve the package’s original folder structure.
- Restore only the configuration entries you need.
- Run:
php.exe -v
php.exe --ini
Do not copy individual DLLs from a different PHP release. Manual copying is safe only when recovering the exact file from the exact official package that matches the rest of the installation.
If files repeatedly disappear, check disk health and the application’s update logs.
Fix 6: Repair Windows components only when other system files fail
php7ts.dll is a third-party PHP file. System File Checker and DISM normally do not restore it. Use them when Windows itself has additional corruption, failed system components, or unrelated protected files that are also malfunctioning.
- Open Start.
- Search for Command Prompt.
- Select Run as administrator.
- Run:
DISM.exe /Online /Cleanup-Image /RestoreHealth
- Wait for it to finish.
- Then run:
sfc /scannow
- Restart Windows.
- Test the PHP application again.
If you prefer help identifying which Windows component is damaged while you work through DISM and SFC manually, Outbyte PC Repair can scan for problems and show what needs attention; repairs are performed by the full version, and it is not a substitute for reinstalling the PHP application that owns this file.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Do not expect SFC or DISM to recreate a missing PHP runtime DLL.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Fix 7: Check drivers only when the failure is broader
A graphics, storage, or chipset driver is not a normal cause of a missing php7ts.dll. Investigate drivers only if Windows is also crashing, devices are failing, or the PHP application triggers a wider system problem.
- Right-click Start.
- Select Device Manager.
- Expand the relevant device category.
- Right-click the affected device.
- Select Properties and review the Device status message.
- Open the Driver tab.
- Select Update Driver and choose Search automatically for drivers.
- Restart Windows if a driver is installed.
- Test the PHP application again.
For a recently updated device, use Roll Back Driver if the button is available. Windows Features are not a repair for php7ts.dll, but you can check required server components under Turn Windows features on or off if the application specifically depends on IIS or another Windows feature.
If manually checking every device and matching driver package is becoming guesswork, Outbyte Driver Updater can scan for outdated drivers and identify the affected hardware; driver installation is handled by the full version, and it should not replace the application-specific PHP repair.
Why regsvr32 is not the fix
Do not run:
regsvr32 php7ts.dll
regsvr32 is intended for DLLs that expose registration entry points such as DllRegisterServer, commonly used by COM or ActiveX components. PHP’s runtime core is loaded by PHP, Apache, or the application launcher. It is not repaired by registering it in Windows.
The command may produce another error and does not fix missing dependencies, incorrect architecture, TS/NTS mismatches, or a missing PHP installation.
Why random DLL downloads are unsafe
A loose DLL from an unknown download site can contain malware, belong to another PHP release, use the wrong architecture, or be incompatible with the executable and extensions already installed. It may also hide the real problem, such as antivirus removal, a broken update, or a missing Visual C++ dependency.
Use the official application installer or the official PHP Windows package. Microsoft runtime files should come only from Microsoft’s official Visual C++ Redistributable downloads.
Recommended Free Tools
PHP 7 compatibility warning
PHP 7.0 through 7.2 are obsolete branches. PHP 7.2 reached end of life on 30 November 2020. If the application supports a newer PHP branch, plan an upgrade after testing its code, extensions, framework, and database compatibility. Do not assume every PHP 7 application can move to PHP 8 without testing.
FAQ
Is php7ts.dll part of Windows?
No. It is a PHP runtime file supplied by PHP or by an application that bundles PHP.
Should I put it in System32?
No. Restore it to the PHP directory belonging to the application that loads it.
Is php7ts.dll the same as php7nts.dll?
No. php7ts.dll is associated with a Thread Safe build. NTS builds are intended for different hosting arrangements, commonly FastCGI.
Why does PHP still fail when the file exists?
A dependency may be missing, or PHP may be loading the wrong architecture, extension, version, or directory. Check php.exe -v, where php, php.exe --ini, and the exact error text.
What information should I provide to an administrator?
Provide the full error message, the application or server involved, the output of php.exe -v, the result of where php, the configured PHP directory, and what changed immediately before the failure.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




