October 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 PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

php_gmp.dll Errors: Diagnose PHP’s GMP Extension on Windows

Length12 min Posted Quest giverVGSources Team

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.

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.

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

It is an application component, not a Windows system file. It should normally be located here:

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.

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

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.dll is missing
  • extension_dir points 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.ini than 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.

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

“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.

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

If where php lists more than one executable, test the intended installation directly:

"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.

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

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:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

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

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

  1. Record the output of php --ini and php -i.
  2. Stop Apache, IIS, or the application using PHP.
  3. Download the matching complete PHP archive from the official PHP source.
  4. Extract it to a clean directory.
  5. Confirm that the new ext directory contains php_gmp.dll.
  6. Copy or recreate the required php.ini settings.
  7. Set extension_dir to the new absolute ext path.
  8. Enable extension=gmp.
  9. Update the web server or application to use the new PHP directory.
  10. Restart the service.
  11. Verify with php -m and 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.

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

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:

Installation steps

  1. Check PHP architecture:

bat
php -i | findstr /I Architecture

  1. Download the matching installer from Microsoft.
  2. Run the installer.
  3. Choose Repair if that version is already installed, or complete the installation.
  4. Restart the PHP service or application.
  5. 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.

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

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.

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

Windows Security steps

  1. Open Start.
  2. Search for Windows Security.
  3. Select Virus & threat protection.
  4. Open Protection history.
  5. Look for an event involving php_gmp.dll or the PHP installation directory.
  6. Review the detection and file path.
  7. Restore the file only if the PHP package came from the official source and you trust the installation.
  8. If uncertain, do not restore it. Delete the damaged installation and reinstall PHP from the official source.
  9. 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.

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:

  1. Open Start and search for Environment Variables.
  2. Select Edit the system environment variables.
  3. Click Environment Variables.
  4. Under User variables and System variables, inspect Path.
  5. Move the intended PHP directory above obsolete PHP paths, or remove paths no longer used.
  6. Click OK on each dialog.
  7. Open a new Command Prompt.
  8. Run where php again.
  9. 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.

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

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:

  1. Open Settings.
  2. Select Apps.
  3. Open Installed apps.
  4. Select the affected program.
  5. Choose Advanced options if available.
  6. Select Repair or Modify.
  7. Restart Windows if requested.
  8. 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.

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

Driver repair is relevant only if the failing application also reports a separate device or hardware error. In that case:

  1. Right-click Start.
  2. Select Device Manager.
  3. Expand the relevant device category.
  4. Right-click the affected device.
  5. Select Update driver.
  6. Choose Search automatically for drivers.
  7. If the problem began after an update, open Properties, select the Driver tab, and use Roll Back Driver when available.
  8. 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.Support on Ko-Fi

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

  1. Open Start.
  2. Search for Command Prompt.
  3. Right-click it.
  4. Select Run as administrator.
  5. Run:
DISM.exe /Online /Cleanup-Image /RestoreHealth
  1. Wait for it to finish.
  2. 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.

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

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.

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

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.ini is the file you edited.
  • extension_dir points to the correct PHP ext directory.
  • php_gmp.dll exists there.
  • gmp appears 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.

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

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:

  1. Open Start.
  2. Search for Create a restore point.
  3. Open it.
  4. Select System Restore.
  5. Choose a restore point created before the failure.
  6. Review affected programs.
  7. 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_dir path
  • Whether php_gmp.dll exists
  • 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.

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

Which 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.

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

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.

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 *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

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.