php7.dll is the PHP 7 non-thread-safe core runtime, not a Windows system file. When Windows reports that php7.dll is missing or could not be loaded, repair the PHP installation or application that supplied it rather than copying a random DLL into System32.
PHP applications commonly use this file in command-line tools, local web stacks, Apache or IIS FastCGI setups, developer utilities, and application launchers. The correct repair depends on the PHP package being used.
As an Amazon Associate I earn from qualifying purchases.
Identify the PHP build before repairing it
Open the folder that contains php.exe. In that folder, check whether php7.dll is present beside the executable. Then open Command Prompt there and run:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
php.exe -v
php.exe -i
dir php7.dll
If Windows may be using another PHP installation, use the full path:
#1 Best Overall
"C:pathtophpphp.exe" -v
For a broader check, run:
where php
echo %PATH%
php.exe -i | findstr /I "PHP Version Architecture Thread Safety Loaded Configuration File"
Use the results to identify the relevant package:
| Check | What it tells you | Correct match |
|---|---|---|
| PHP version | Whether the application uses PHP 7.0 through 7.4 | Use the same PHP release family and compatible point release |
| Architecture | Whether the process is 32-bit or 64-bit | x86 PHP for a 32-bit process, x64 PHP for a 64-bit process |
| Thread safety | Whether the build is NTS or TS | NTS for CLI and FastCGI; TS generally for Apache modules |
| PHP directory | Which installation is active | Repair or configure this directory, not an unrelated copy |
php7.dll belongs to non-thread-safe PHP 7 builds. Thread-safe builds use php7ts.dll; substituting one for the other is not a valid repair. PHP 7 Windows packages also vary by compiler build and point release, so there is no universal file size or version that applies to every installation.
1. Repair the application or PHP package that owns the file
This is the most likely fix. A PHP installation can lose its runtime after an incomplete update, interrupted uninstall, directory move, cleanup utility, or launcher repair.
First identify what reported the error:
php.exe: a standalone PHP installation or command-line tool- Apache: an Apache module or local development stack
- IIS: a FastCGI mapping
- An application launcher: a bundled PHP directory
- A service: a service-specific PHP path that may differ from your user
PATH
Repair a bundled application
- Close the affected application and its launcher.
- Open Settings.
- Select Apps > Installed apps.
- Select the application that displays the error.
- Choose Advanced options, if available.
- Select Repair or Reset, depending on what the application provides.
- If no repair option exists, uninstall the application.
- Restart Windows.
- Reinstall it using the developer’s official installer.
- Start the application again.
Some launchers call this option Verify files rather than Repair. Use that function when available because it can restore the complete bundled PHP directory instead of only replacing one file.
For standalone PHP, download the complete matching Windows ZIP package from the official PHP for Windows distribution or the application vendor. Extract it into a new directory rather than mixing files with an older installation. Reconfigure the application, Apache, IIS, or PATH to use that directory.
A successful repair should restore php7.dll beside php.exe. Running the full-path command below should also display PHP version information without a loader error:
"C:pathtophpphp.exe" -v
Do not copy only php7.dll from a different PHP release. Restore the complete package whenever possible.
2. Check Windows Security quarantine
Antivirus software may quarantine a PHP runtime because of a detection, a false positive, or an untrusted package source. The filename alone does not prove that a replacement is safe.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- Open Windows Security from the Start menu.
- Select Virus & threat protection.
- Select Protection history.
- Review entries created when the error began.
- Expand the relevant entry and inspect its file path and detection details.
- If the file came from the official PHP package or the application’s official installer, verify its provenance before taking action.
- Restore or allow it only when you are confident that the package is genuine.
- If the origin is uncertain, leave it quarantined.
- Reinstall the complete application or PHP package from its official source instead.
If restoring the file makes the application start, scan the system and replace the package with a clean official installation. If Windows Security continues to remove the file, do not repeatedly bypass the detection. Investigate the package and its authenticity first.
3. Install or repair the Microsoft Visual C++ runtime
A “specified module could not be found” message does not always mean that php7.dll itself is absent. Windows can show the same message when a dependency required by php7.dll is missing.
Official PHP Windows builds require a compatible Microsoft Visual C++ Redistributable. The architecture must match the PHP build:
- Install the x86 redistributable for 32-bit PHP.
- Install the x64 redistributable for 64-bit PHP.
- On 64-bit Windows, both may be needed when separate 32-bit and 64-bit applications are installed.
To repair an existing package:
- Open Settings.
- Select Apps > Installed apps.
- Search for Microsoft Visual C++ Redistributable.
- Select the three-dot menu beside the relevant package.
- Choose Modify.
- Select Repair.
- Restart the affected application or service.
You can also install the current supported Microsoft Visual C++ Redistributable packages from Microsoft’s official download page. The Microsoft links are:
Recommended Free Tools
- x86:
https://aka.ms/vc14/vc_redist.x86.exe - x64:
https://aka.ms/vc14/vc_redist.x64.exe
After the repair, run:
"C:pathtophpphp.exe" -v
If the command still fails and php7.dll exists, confirm the PHP architecture, compiler build, dependent DLLs, and application search path. Installing Visual C++ will not recreate a deleted php7.dll.
4. Correct a stale PHP path
Multiple PHP installations often cause confusing results. Your terminal may use one PHP directory while Apache, IIS, a service, or an application launcher uses another.
Run:
where php
echo %PATH%
If where php lists an old directory first, correct the PATH:
- Open Start and search for Edit the system environment variables.
- Open it and select Environment Variables.
- Under User variables or System variables, select
Path. - Choose Edit.
- Move the intended PHP directory above obsolete PHP entries, or remove stale entries.
- Select OK on each dialog.
- Open a new Command Prompt.
- Run
where phpagain.
For Apache, inspect the PHP module or FastCGI configuration and confirm that it points to the intended PHP directory. For IIS:
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 match- Open IIS Manager.
- Select the server or affected site.
- Open Handler Mappings and FastCGI Settings.
- Check the executable path for the PHP FastCGI process.
- Correct it if it points to an old or deleted directory.
- Restart the site or IIS service.
A command-line fix does not automatically correct a service configuration. After changing paths, restart Apache, IIS, the relevant Windows service, or the application launcher.
Success means the application and the command below use the same PHP directory:
"C:pathtophpphp.exe" -i
5. Check architecture and thread-safety compatibility
A 32-bit process cannot use a 64-bit PHP runtime, and a 64-bit process cannot load a 32-bit runtime. PHP’s thread-safety mode also matters.
Check the active build:
php.exe -i | findstr /I "Architecture Thread Safety"
Then match the installation:
- x86 with a 32-bit application
- x64 with a 64-bit application
- NTS for typical CLI and IIS/FastCGI installations
- TS for typical Apache module installations
Do not rename php7ts.dll to php7.dll, copy a PHP 8 runtime into a PHP 7 directory, or combine files from different PHP packages. Install the complete matching build instead.
6. Repair broader Windows component corruption
System File Checker does not normally restore php7.dll, because PHP is not owned by Windows. Use these commands only when several unrelated applications also show missing or corrupted system files.
- Open Start.
- Search for Command Prompt.
- Right-click it and select Run as administrator.
- Run DISM first:
DISM.exe /Online /Cleanup-Image /RestoreHealth
- When it finishes, run:
sfc /scannow
- Restart Windows.
- Test the PHP application again.
Success means Windows reports that the component repair completed and other system-file errors stop appearing. If only the PHP application remains broken, repair or reinstall its PHP package instead.
Rank #4
When repeatedly running DISM and SFC becomes guesswork, Outbyte PC Repair can scan for system issues and show what needs attention; repairs are performed by the full version, while reinstalling the owning PHP application remains the definitive fix for a missing php7.dll.
7. Update drivers only when the wider failure points to them
A graphics or device driver is not normally responsible for a missing PHP runtime. Consider driver repair only if the application also crashes with device errors, Windows reports hardware failures, or several programs fail after a driver update.
- Right-click Start.
- Select Device Manager.
- Expand the category for the affected device.
- Right-click the device.
- Select Update driver.
- Choose Search automatically for drivers.
- Restart Windows.
- Test the application again.
If the problem began immediately after a driver update, open the device’s Properties, select the Driver tab, and choose Roll Back Driver when available. Do not replace php7.dll as a substitute for fixing a device driver.
When checking every device manually is impractical, Outbyte Driver Updater can scan for outdated drivers and identify what needs updating; driver installation is handled by the full version, and it is not a replacement for repairing the PHP package that owns php7.dll.
What not to do
Do not copy it to System32 or SysWOW64
php7.dll is not a Windows system DLL. Copying it to C:WindowsSystem32 or C:WindowsSysWOW64 can create version conflicts and hide which PHP installation is actually being used.
Keep the file in the PHP or application directory beside the matching runtime files.
Free tools Windows power users keep installed
One-click scans. No signup required.
Do not download an isolated DLL from a random website
Unverified DLL downloads can contain malware, use the wrong architecture, belong to a different PHP point release, or omit the dependencies that caused the failure. They also make it harder to verify the file’s origin.
Use the application developer’s official installer or the official PHP Windows archive. Restore the complete matching package rather than relying on a filename match.
Do not run regsvr32 php7.dll
regsvr32 is intended for DLLs that provide registration entry points, such as certain ActiveX or COM components. PHP’s core runtime is loaded by php.exe, Apache, or FastCGI and is not repaired by registering it.
Do not enable random Windows Features
Enabling IIS, legacy components, or other Windows Features will not automatically restore a PHP runtime. Enable IIS only when the application requires it, then configure its PHP FastCGI path with the correct build.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →PHP 7 support and migration
PHP 7.4.33 was the final PHP 7.4 release, and PHP 7.4 reached end of life on November 28, 2022. If the application supports PHP 8, migration is preferable. If it requires PHP 7, isolate it and use the exact build supported by the application vendor or the official PHP archive.
FAQ
Is php7.dll part of Windows?
No. It belongs to a PHP 7 installation or an application that bundles PHP.
Should I replace php7.dll with php7ts.dll?
No. php7.dll is used by non-thread-safe builds, while php7ts.dll belongs to thread-safe builds. Install the correct complete package.
Why does Windows say the module is missing when the file exists?
A dependency of php7.dll may be missing, commonly the matching Visual C++ runtime. A wrong architecture, stale path, or incompatible PHP package can produce the same message.
Will SFC restore php7.dll?
Normally no. SFC repairs Windows-protected files, not third-party PHP files. Reinstall the owning application or PHP package.
Can I use PHP 8’s DLL instead?
No. PHP 8 runtime files are not interchangeable with PHP 7 files. Upgrade the application and its PHP configuration as a complete migration.
What should I do if the error returns after every reinstall?
Check Windows Security Protection history, verify that the application is not loading another PHP directory through PATH, and confirm that the selected package matches the process architecture and thread-safety mode.
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.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errors




