Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Blog

php7ts.dll Missing: Rebuild the Right PHP Setup on Windows

Length9 min Posted Quest giverVGSources Team

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find the program that installed it

Before replacing anything, identify which PHP installation is failing.

Check PHP from Command Prompt

  1. Press Start.
  2. Type Command Prompt.
  3. Open it.
  4. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. Close the application, Apache, PHP terminals, and related launchers.
  2. Open Settings.
  3. Select Apps and then Installed apps.
  4. Find the PHP-based application, server package, or development environment.
  5. Select the three-dot menu.
  6. Choose Advanced options, if available.
  7. Select Repair or Reset, depending on what the application provides.
  8. Start the application again.

If there is no repair option:

  1. Download the application again from its developer’s official installer source.
  2. Uninstall the existing copy only after backing up its projects, configuration, and databases.
  3. Restart Windows.
  4. Install the same application again.
  5. Restore your projects and configuration carefully.
  6. 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:

  1. Open Windows Security.
  2. Select Virus & threat protection.
  3. Choose Protection history.
  4. Look for a detection involving the application’s PHP directory.
  5. Confirm that the file came from the official application or PHP package.
  6. Do not restore it blindly. If the origin is uncertain, reinstall the complete package instead.
  7. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A 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:

  1. Press Start and search for environment variables.
  2. Select Edit the system environment variables.
  3. Select Environment Variables.
  4. Edit the relevant Path entry under User variables or System variables.
  5. Remove stale PHP paths or move the correct one above them.
  6. Select OK on every dialog.
  7. Open a new Command Prompt and run where php again.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

  1. Open Microsoft’s official Visual C++ Redistributable downloads page.
  2. Download the architecture that matches PHP.
  3. Install x86 for a 32-bit PHP build, even on 64-bit Windows.
  4. Install x64 for a 64-bit PHP build.
  5. Run the installer.
  6. Choose Repair if it is already installed, or complete the installation if it is missing.
  7. Restart Windows.
  8. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix 4: Disable an incompatible PHP extension

An extension added after the PHP installation can cause startup warnings or entry-point failures.

  1. Run:
php.exe --ini
  1. Open the reported php.ini file in a text editor.
  2. Look for recently added extension= lines.
  3. Add a semicolon at the beginning of a suspect line, for example:
;extension=example.dll
  1. Save the file.
  2. Run:
php.exe -v
  1. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Close all PHP and Apache processes.
  2. Delete or rename the incomplete PHP directory after backing up configuration and project files.
  3. Download the complete package from the official PHP Windows archive.
  4. Extract it with a reliable archive utility.
  5. Preserve the package’s original folder structure.
  6. Restore only the configuration entries you need.
  7. 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.

  1. Open Start.
  2. Search for Command Prompt.
  3. Select Run as administrator.
  4. Run:
DISM.exe /Online /Cleanup-Image /RestoreHealth
  1. Wait for it to finish.
  2. Then run:
sfc /scannow
  1. Restart Windows.
  2. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.Support on Ko-Fi

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.

  1. Right-click Start.
  2. Select Device Manager.
  3. Expand the relevant device category.
  4. Right-click the affected device.
  5. Select Properties and review the Device status message.
  6. Open the Driver tab.
  7. Select Update Driver and choose Search automatically for drivers.
  8. Restart Windows if a driver is installed.
  9. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How To Create Custom Stickers & Shoutouts In Monster Hunter WildsMonster Hunter WildsBlog20min
  2. How to Get XL Gogoat in Pokemon Legends Z-A (An Extra-Large Gogoat)Pokemon Legends Z-ABlog20min
  3. How to Get Rotting Lightbringer in Diablo 4Diablo 4Blog17min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.