Free tools Windows power users keep installed
One-click scans. No signup required.
PHP Warning: PHP Startup: Unable to load dynamic library 'gmp' is a common error when PHP cannot load php_gmp.dll. You may also see php_gmp.dll was not found, The specified module could not be found, or php_gmp.dll is either not designed to run on Windows or it contains an error.
The safe fix is not to download a random DLL. Restore the complete PHP package that matches your installed PHP version, architecture, compiler, and thread-safety mode, then enable GMP in the php.ini that PHP is actually using.
As an Amazon Associate I earn from qualifying purchases.
What is php_gmp.dll?
php_gmp.dll is the Windows extension that gives PHP access to GMP, or GNU Multiple Precision, for arbitrary-precision integer mathematics. It belongs to PHP for Windows and is produced as part of the PHP distribution by The PHP Group and PHP contributors.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsIt is an application component, not a Windows system file. It should normally be located here:
#1 Best Overall
C:pathtophpextphp_gmp.dll
The exact path depends on where PHP was installed.
It should not be placed in:
C:WindowsSystem32
C:WindowsSysWOW64
C:Windows
Do not copy it into a game folder, application folder, or another PHP installation merely because that is where an error message appeared. PHP loads extensions through its own configuration and extension directory.
PHP versions and builds do not share one universal php_gmp.dll. The file can differ by:
- PHP version and release
- x86 or x64 architecture
- Thread Safe or Non Thread Safe build
- Visual C++ compiler generation
- Debug or non-debug configuration
That is why a DLL that has the right filename can still be incompatible.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →What the error message really means
“Unable to load dynamic library ‘gmp’”
PHP found the configuration entry for GMP but could not load the extension. Possible causes include:
php_gmp.dllis missingextension_dirpoints to the wrong folder- the DLL is incompatible with PHP
- a dependent DLL is missing
- the file was quarantined or damaged
- PHP is using a different
php.inithan expected
“The specified module could not be found”
This message is misleading. It can mean that php_gmp.dll is absent, but it can also mean that Windows cannot find a dependency required by php_gmp.dll.
Installing the Visual C++ Redistributable can help when a runtime dependency is missing. It will not recreate a deleted php_gmp.dll.
“php_gmp.dll was not found”
This usually indicates that the named file is absent from the configured extension directory or that PHP is looking in the wrong directory.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute“Not designed to run on Windows” or “contains an error”
Suspect a corrupted file, wrong architecture, mismatched PHP build, or an incomplete extraction. Do not assume the message proves malware or that Windows itself is damaged.
Check which PHP installation is actually running
Multiple PHP installations are common on Windows. A command prompt may use one copy while Apache, IIS, a control panel, or a scheduled task uses another.
Open Command Prompt and run:
where php
php --ini
php -i | findstr /I "PHP Version Architecture Thread Safety extension_dir Loaded Configuration File"
Record:
- The PHP executable path
- The loaded
php.ini - PHP version
- x86 or x64 architecture
- Thread Safety status
extension_dir- The loaded configuration file
Now check whether the extension exists in the directory PHP reports:
dir "C:pathtophpextphp_gmp.dll"
Replace the example path with the actual extension_dir value.
If where php lists more than one executable, test the intended installation directly:
Rank #2
"C:pathtophpphp.exe" --ini
"C:pathtophpphp.exe" -m
This helps distinguish a damaged PHP installation from a stale PATH entry.
For a web application, command-line results are not enough. The web server may load a different PHP binary and configuration file. Check the PHP information page used by the application, or inspect the web-server startup logs, and compare its PHP version, architecture, loaded configuration file, and extension directory with the command-line output.
Fix 1: Correct php.ini and extension_dir
This is the first repair to try when php_gmp.dll exists.
Step 1: Open the configuration file PHP uses
Run:
php --ini
Find the line named Loaded Configuration File. Open that exact file in a text editor with administrator permission if it is under a protected location.
Do not edit a similarly named file in another PHP directory unless php --ini identifies it as the loaded file.
Step 2: Enable GMP
Find an existing GMP line, such as:
;extension=gmp
Remove the semicolon:
extension=gmp
Modern PHP configurations generally use the extension name. This older filename form is also supported:
extension=php_gmp.dll
Use one form, not both.
Step 3: Correct the extension directory
Confirm that extension_dir points to the ext folder containing the file:
extension_dir="C:pathtophpext"
Avoid a relative path while troubleshooting. An absolute path removes ambiguity between PHP installations.
Step 4: Restart the relevant service
Restart the component that loads PHP:
- Apache
- IIS
- PHP through FastCGI
- A PHP application service
- The application itself
A command-line PHP process reads the configuration when it starts, so close and reopen Command Prompt before testing it again.
Step 5: Verify the extension
Run:
php -m | findstr /I gmp
php -r "var_dump(extension_loaded('gmp'));"
A successful result includes gmp and:
bool(true)
If the file exists but the same warning remains, continue with build matching and runtime checks.
Fix 2: Restore the complete matching PHP package
If php_gmp.dll is missing, damaged, or was removed during an update, reinstalling only the DLL is not the safest repair.
Download the PHP package from the official PHP for Windows download page or its official release archive. Select the same PHP release required by the application. Do not replace an application’s older PHP version with a newer major or minor version simply because it is available.
Match all of these characteristics:
| Requirement | What must match |
|---|---|
| PHP release | The version required by the application |
| Architecture | x86 with x86, or x64 with x64 |
| Thread safety | TS with TS, or NTS with NTS |
| Compiler build | The appropriate Visual C++ build |
| Debug status | Debug with debug, or non-debug with non-debug |
The official Windows packages commonly use names similar to:
php-8.x.y-Win32-vs17-x64.zip
php-8.x.y-nts-Win32-vs17-x64.zip
The exact package name changes between releases. TS builds are generally used with Apache loaded as a module. NTS builds are generally used with IIS, FastCGI, and command-line PHP.
Safe restoration procedure
- Record the output of
php --iniandphp -i. - Stop Apache, IIS, or the application using PHP.
- Download the matching complete PHP archive from the official PHP source.
- Extract it to a clean directory.
- Confirm that the new
extdirectory containsphp_gmp.dll. - Copy or recreate the required
php.inisettings. - Set
extension_dirto the new absoluteextpath. - Enable
extension=gmp. - Update the web server or application to use the new PHP directory.
- Restart the service.
- Verify with
php -mand the web application separately.
Do not overwrite a working PHP directory before preserving its configuration. If the application depends on other extensions or custom settings, compare the old and new php.ini files carefully.
A complete matching package is safer than a standalone DLL because PHP extensions and their supporting files are built and distributed as a set.
Fix 3: Install the correct Visual C++ Redistributable
If php_gmp.dll exists and extension_dir is correct, Windows may be unable to load a required runtime dependency.
PHP for Windows requires the architecture-appropriate Microsoft Visual C++ Redistributable:
- x86 PHP requires the x86 runtime
- x64 PHP requires the x64 runtime
Use Microsoft’s official downloads:
- Microsoft Visual C++ Redistributable downloads
- Visual C++ Redistributable x86 installer
- Visual C++ Redistributable x64 installer
Installation steps
- Check PHP architecture:
bat
php -i | findstr /I Architecture
- Download the matching installer from Microsoft.
- Run the installer.
- Choose Repair if that version is already installed, or complete the installation.
- Restart the PHP service or application.
- Test again:
bat
php -m | findstr /I gmp
Installing the runtime will not fix a missing extension file. If dir cannot find php_gmp.dll, restore the matching PHP archive first.
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 →Fix 4: Resolve x86, x64, TS, NTS, and version mismatches
A common failed repair is copying an x86 extension into an x64 PHP installation, or mixing a TS extension with NTS PHP.
Check the active PHP build:
php -i | findstr /I "PHP Version Architecture Thread Safety"
Then compare it with the package from which php_gmp.dll came.
Do not mix:
- PHP 7 extensions with PHP 8
- One PHP 8 release with another without confirming compatibility
- x86 files with x64 PHP
- TS files with NTS PHP
- Debug files with non-debug PHP
- Files built with incompatible compiler runtimes
If you cannot establish where the DLL came from, replace the complete PHP installation with the correct official package rather than guessing.
Fix 5: Check antivirus quarantine
Windows Security or third-party antivirus software may quarantine a PHP extension after an update or extraction.
Recommended Free Tools
Windows Security steps
- Open Start.
- Search for Windows Security.
- Select Virus & threat protection.
- Open Protection history.
- Look for an event involving
php_gmp.dllor the PHP installation directory. - Review the detection and file path.
- Restore the file only if the PHP package came from the official source and you trust the installation.
- If uncertain, do not restore it. Delete the damaged installation and reinstall PHP from the official source.
- Retest the extension.
Do not create a broad antivirus exclusion for the entire Windows directory or for every downloaded file. If an exception is necessary in a controlled environment, limit it to the trusted PHP directory and confirm that the package’s origin is known.
Rank #4
Fix 6: Remove multiple-PHP path confusion
A stale PATH entry can cause PHP to use an old installation even after you repaired a newer one.
Run:
where php
If several paths appear, decide which PHP installation the application should use. Then:
- Open Start and search for Environment Variables.
- Select Edit the system environment variables.
- Click Environment Variables.
- Under User variables and System variables, inspect
Path. - Move the intended PHP directory above obsolete PHP paths, or remove paths no longer used.
- Click OK on each dialog.
- Open a new Command Prompt.
- Run
where phpagain. - Confirm with
php --ini.
A Windows service may use a configured absolute path instead of PATH. Check the service, FastCGI configuration, Apache configuration, or application launcher separately.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Fix 7: Repair the application that bundles PHP
Some desktop applications, control panels, and developer tools include their own PHP runtime. In that case, repairing your system PATH or a separate PHP installation may not affect the failing program.
Use the application’s official installer or repair option:
- Open Settings.
- Select Apps.
- Open Installed apps.
- Select the affected program.
- Choose Advanced options if available.
- Select Repair or Modify.
- Restart Windows if requested.
- Launch the application again.
If no repair option exists, uninstall the application, restart Windows, and reinstall it from the developer’s official source. Preserve application data and configuration first.
Fix 8: Update or reinstall a related driver only when the application needs one
php_gmp.dll itself is not a hardware driver, and Device Manager does not repair PHP extensions. Do not update graphics, audio, chipset, or storage drivers as a general response to this PHP error.
Driver repair is relevant only if the failing application also reports a separate device or hardware error. In that case:
- Right-click Start.
- Select Device Manager.
- Expand the relevant device category.
- Right-click the affected device.
- Select Update driver.
- Choose Search automatically for drivers.
- If the problem began after an update, open Properties, select the Driver tab, and use Roll Back Driver when available.
- Restart Windows and test the application.
Outbyte Driver Updater can scan for outdated drivers when manually checking many hardware categories is impractical; its free scan identifies issues, while driver installation is handled by the full version. It is not a substitute for restoring the matching PHP package.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Fix 9: Use DISM and SFC only for broader Windows corruption
php_gmp.dll is not a protected Windows system file, so System File Checker normally will not restore it. Use these commands only when Windows has other symptoms, such as damaged built-in components, failed system updates, or widespread application errors.
Run DISM
- Open Start.
- Search for Command Prompt.
- Right-click it.
- Select Run as administrator.
- Run:
DISM.exe /Online /Cleanup-Image /RestoreHealth
- Wait for it to finish.
- Restart Windows if requested.
Run SFC
Open an elevated Command Prompt again and run:
sfc /scannow
Wait for verification to reach 100 percent, then restart Windows and test PHP.
Recommended Free Tools
Microsoft documents DISM repair and System File Checker. These commands can repair Windows components, but they generally cannot replace a third-party PHP extension.
If repeatedly running SFC and DISM is becoming guesswork, Outbyte PC Repair can show a scan of reported system issues; its free scan identifies problems, while repairs are performed by the full version. Reinstalling the affected PHP application remains the definitive repair when its own files are missing.
Why regsvr32 is not the fix
Do not run:
regsvr32 php_gmp.dll
regsvr32 is used for DLLs that expose registration entry points such as DllRegisterServer, commonly for COM components. PHP extensions are loaded by PHP through php.ini; they are not registered as Windows components.
Running regsvr32 may produce another error without changing PHP’s configuration. It does not correct extension_dir, install missing dependencies, or make an incompatible build load.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Is manually copying php_gmp.dll safe?
Only when the file comes from the exact trusted PHP distribution matching the running installation. A random DLL download can have the wrong:
- PHP version
- Architecture
- Thread-safety mode
- Compiler runtime
- Build type
It can also be corrupted or malicious, and it leaves the underlying PHP installation inconsistent.
Do not use DLL download websites as a repair source. Restore the complete PHP package from the official PHP for Windows distribution, then configure PHP to load the extension from its own ext directory.
Final verification checklist
Run these commands from a new Command Prompt:
where php
php --ini
php -i | findstr /I "PHP Version Architecture Thread Safety extension_dir Loaded Configuration File"
php -m | findstr /I gmp
php -r "var_dump(extension_loaded('gmp'));"
Confirm that:
- The intended PHP executable is listed first.
- The loaded
php.iniis the file you edited. extension_dirpoints to the correct PHPextdirectory.php_gmp.dllexists there.gmpappears in the module list.- The final command returns
bool(true).
For a web server, verify separately through the application’s PHP information page or logs. A successful CLI test does not prove that IIS, Apache, or another service is using the same PHP installation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
When to use System Restore
System Restore is reasonable when the error began immediately after a known update, failed application repair, or configuration change and a clean PHP package is not available.
To check restore points:
- Open Start.
- Search for Create a restore point.
- Open it.
- Select System Restore.
- Choose a restore point created before the failure.
- Review affected programs.
- Complete the restore only after confirming the impact.
System Restore should not be the first choice when replacing PHP with a matching official package is straightforward.
Information to collect if the error remains
When asking for technical help, include:
- The complete error text
- PHP version
- Output of
php --ini - Relevant output from
php -i - x86 or x64 architecture
- TS or NTS status
- Full PHP path
- Full
extension_dirpath - Whether
php_gmp.dllexists - Whether CLI and web-server PHP behave differently
- Antivirus protection history
- Apache, IIS, FastCGI, or application startup logs
Do not post passwords, API keys, database credentials, or private application configuration.
FAQ
Is php_gmp.dll a Windows file?
No. It is a PHP extension and normally belongs in the ext directory of the PHP installation.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Which PHP versions include GMP?
GMP is provided as a PHP extension in supported PHP distributions, but the exact DLL depends on the PHP release and build. Use the package required by the application rather than mixing files between releases.
Should I copy php_gmp.dll into System32?
No. PHP should load it from its own ext directory.
Can the Visual C++ Redistributable restore php_gmp.dll?
No. It can provide a missing runtime dependency, but it cannot recreate the PHP extension itself.
Why does PHP say the module is missing when the file is present?
The message may refer to a dependent DLL, an incorrect extension_dir, a wrong architecture, an incompatible TS/NTS build, or a damaged file.
Can I use regsvr32?
No. PHP extensions are loaded through php.ini, not registered with regsvr32.
Free tools Windows power users keep installed
One-click scans. No signup required.
What is the safest source for this file?
The complete PHP package from the official PHP for Windows distribution, matched to the installed PHP version, architecture, compiler, 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.




