October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober 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

How to Fix “cURL Is Not Installed in Your PHP Installation”

A practical guide to diagnosing and fixing PHP cURL errors by matching the extension, php.ini, PHP version and SAPI that actually runs your code.
WorldYour PHP Installation” Length9 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.

The message means the PHP runtime handling your command or web request does not have the cURL extension loaded. Install or enable cURL for that exact PHP installation, restart the process that uses PHP, and verify the extension through the same SAPI. The most common cause is that command-line PHP and the web server use different versions or different php.ini files.

What the error means

PHP’s cURL functions are provided by the cURL extension, which is built against the libcurl library. Applications such as Composer, content-management systems and API clients can stop with messages such as “cURL is not installed in your PHP installation” or “Your PHP installation appears to be missing the cURL extension.” The application is not saying that the operating system’s standalone curl command is absent. It is reporting that the PHP process that ran the code cannot load the PHP cURL module.

As an Amazon Associate I earn from qualifying purchases.

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

Installing a command-line cURL package alone therefore may not fix the problem. PHP must be compiled or packaged with cURL support, its configuration must enable the module, and all required libraries must be available to the process. PHP’s documentation states that the libcurl package is required for PHP cURL functions.

Identify the PHP runtime that fails

Do not change configuration until you know which PHP binary, configuration file and SAPI produced the error. A shell, Apache module, Nginx with PHP-FPM, IIS and Composer can all invoke different PHP installations.

Check command-line PHP

  1. Display the PHP version and build: php -v.
  2. Show the configuration files PHP searches and loads: php --ini. Note both the “Loaded Configuration File” and the “Scan for additional .ini files” directory.
  3. Check whether cURL is loaded: php -m | grep -i curl. On Windows, use php -m | findstr /i curl.

If php --ini reports an unexpected or empty configuration file, you may be editing the wrong file. Use the path printed by that command rather than assuming a system-wide location.

Check a web request

A browser request can use another PHP minor version, SAPI or configuration file even when the terminal reports cURL successfully. Create a temporary diagnostic script in the affected site’s document root:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
var_dump(PHP_VERSION, PHP_SAPI);
var_dump(php_ini_loaded_file());
var_dump(extension_loaded('curl'));
?>

Request the script through the same URL that fails. It reveals the web server’s PHP version, SAPI, loaded configuration path and cURL status. Delete the file immediately after testing; a publicly reachable diagnostic page discloses server details.

Check the process used by Composer

Run Composer from the same shell, user account and project environment in which the failure occurs. Compare its PHP executable with the result of php -v and test that executable with php -m and php --ri curl. A Composer process launched by a scheduled job, deployment service or IDE can have a different PATH and therefore a different PHP binary.

Install cURL on Debian or Ubuntu

Distribution packages normally install libcurl and the PHP module together. The package name must match the PHP version that serves the failing request. On systems using the distribution’s default PHP, start with:

sudo apt update
sudo apt install php-curl

If several PHP minor versions are installed, use the versioned package instead. For example, a PHP 8.3 installation may require:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt install php8.3-curl
Situation Package approach What to confirm
One PHP version supplied by the distribution php-curl The package’s PHP dependency matches the output of php -v.
Several PHP minor versions installed A versioned package such as php8.3-curl The suffix is the same minor version used by the failing SAPI.
PHP-FPM service with a versioned socket The matching versioned cURL package The FPM pool and package use the same PHP minor version.

MediaWiki’s current local-development instructions include php-curl among Debian/Ubuntu prerequisites, illustrating that the module is installed as a PHP package rather than as a separate application setting.

Restart the PHP consumer

Installing a module does not change an already running worker. Restart the service that owns the failing SAPI:

  • Apache with an embedded PHP module: sudo systemctl restart apache2.
  • PHP-FPM: restart the exact service, such as sudo systemctl restart php8.3-fpm, using the version shown by your system.
  • Nginx: restart or reload Nginx after restarting the PHP-FPM service it proxies to.

If your distribution uses a different service name, list the installed PHP-FPM units and restart the one referenced by the site’s pool configuration. A terminal check can turn green while old web workers continue to run without cURL.

Enable cURL on Windows

Windows PHP distributions generally include the cURL extension as a module, but it may be disabled or unable to find its dependent DLLs.

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

Use the configuration file reported by PHP

  1. Run the failing PHP executable with php --ini, or use the temporary web diagnostic page if the failure is in a browser.
  2. Open the reported php.ini with administrative permission if it is under a protected installation directory.
  3. Find the cURL extension entry. Remove its leading semicolon if present. Depending on the PHP build, the line may be written as extension=curl or extension=php_curl.dll.
  4. Check that extension_dir points to the ext directory belonging to that same PHP installation. Do not point a 64-bit build at another installation’s extensions.
  5. Save the file and restart Apache, IIS or PHP-FPM. A web server must be restarted even if a new terminal sees the edited file.

Resolve Windows DLL dependencies

PHP’s Windows installation documentation specifies that cURL also needs the OpenSSL DLLs (libcrypto-*.dll and libssl-*.dll) and libssh2.dll available on PATH. Use the files shipped for the matching PHP build and architecture. Do not download an unrelated standalone libcurl.dll; mixing DLL versions is a common cause of startup failures.

When PHP prints “Unable to load dynamic library curl”, read the complete warning. It often names the missing DLL or the path PHP attempted. Correct that dependency or path first, then restart the service and test again.

Build PHP with cURL from source

A source-built PHP must be configured to use libcurl. PHP’s installation documentation specifies the --with-curl[=DIR] configure option. The directory supplied to DIR must provide cURL headers in its include path and the libcurl library in its library path.

  1. Install a libcurl development package, not only a runtime package, so the headers and linker files are present.
  2. Choose a libcurl release supported by your PHP version. The PHP manual lists minimum versions that vary by release.
  3. Configure PHP with --with-curl=DIR, where DIR identifies the libcurl installation, then rebuild and install PHP using your normal build procedure.
  4. Run php --ri curl with the newly installed binary and confirm that the web SAPI uses the same build if the original failure was in a web request.

Changing a system libcurl after PHP has been compiled does not automatically add cURL support to that PHP binary. Reconfigure and rebuild when the extension was omitted at compile time.

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

Libcurl compatibility requirements

PHP’s current cURL requirements page gives these minimum libcurl versions. They are compatibility thresholds, not performance measurements:

PHP release Minimum libcurl stated by PHP Qualification
PHP generally 7.10.5 or later General baseline listed by the PHP manual.
PHP 7.3 and later 7.15.5 or later Requirement for the PHP 7.3+ line.
PHP 8.0 and later 7.29.0 or later Requirement for the PHP 8.0+ line.
PHP 8.4 and later 7.61.0 or later Requirement listed for PHP 8.4+.

If a source build links against an older library, the configure step may reject it or the resulting extension may not provide the capabilities expected by that PHP release. Distribution packages normally handle this dependency selection for you.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the repair through the same SAPI

Use more than one check when the failing application is not the terminal:

  • php -m should list curl.
  • php --ri curl should display cURL extension information and its linked libcurl details.
  • php -r 'var_dump(extension_loaded("curl"));' should output bool(true) in a POSIX shell. In Windows PowerShell, use the PHP executable with the same expression and quoting appropriate to that shell.
  • Repeat the extension_loaded('curl') check through the temporary web script for Apache, Nginx/PHP-FPM or IIS.

Only the check performed by the failing SAPI is conclusive. A successful CLI result does not prove that an Apache module or PHP-FPM pool has reloaded the extension.

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

Troubleshoot common failure patterns

Symptom Likely cause Action
php -m has no cURL entry The module is not installed, not enabled, or the CLI loads another php.ini. Run php --ini, install the matching package or enable the module, then test again.
CLI has cURL, website does not Different PHP version, SAPI or configuration file. Use the web diagnostic script to identify its version and loaded file; install or enable cURL for that runtime and restart its service.
Editing php.ini changes nothing The edited file is not the one loaded by the failing process. Trust the path from php --ini or php_ini_loaded_file(), not a guessed location.
PHP Startup: Unable to load dynamic library curl Wrong extension_dir, mismatched architecture or thread-safety build, missing dependency DLL, or an incompatible module. Read the full startup warning, correct the named path or dependency, and use an extension built for the exact PHP build.
A versioned APT package cannot be installed or has no effect The package minor version does not match the running PHP minor version. Compare php -v with the package suffix and with the web SAPI’s reported version.
Installation appears successful but the error remains Apache, PHP-FPM, IIS or another long-running consumer was not restarted. Restart the relevant service and repeat the check through that service.
Windows startup warning names OpenSSL or libssh2 A required DLL is absent from PATH or came from a different PHP build. Place the matching DLLs supplied with the PHP build on the service account’s PATH; restart the service.

When cURL works in the terminal but not in Apache or PHP-FPM

This is the most frequent source of confusion on development servers. The shell may resolve php to one installation while Apache loads a module compiled for another version, or Nginx may proxy to an FPM pool with a separate binary.

  1. Record the CLI version and configuration with php -v and php --ini.
  2. Record the web version, SAPI and configuration path with php_ini_loaded_file() and PHP_SAPI.
  3. Install or enable cURL for the web version, not merely for the CLI version.
  4. Restart the web server or the exact FPM service serving the site.
  5. Remove the diagnostic script and retry the original request or Composer operation.

If multiple FPM pools exist, check each pool’s PHP-FPM service and socket. Restarting an unrelated pool will not change the workers handling the failing virtual host.

Fixing Composer’s “ext-curl is missing” message

Composer evaluates PHP platform requirements using the PHP executable that launches it. Install the cURL extension for that executable and verify it before rerunning the dependency operation.

  1. From the project environment, run php -v, php --ini and php -m | grep -i curl (or the Windows equivalent).
  2. If cURL is absent, install the matching Linux package, enable the Windows module, or rebuild PHP with --with-curl.
  3. Restart any service or shell integration that supplies a different PHP binary, then repeat php --ri curl.
  4. Run Composer again from the same account and environment that originally reported ext-curl as missing.

Do not suppress the platform requirement merely to make installation continue. Packages that expect cURL can fail later at runtime, leaving a less obvious error than the original diagnostic.

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

Keep the configuration consistent

  • Document the PHP minor version and SAPI used by each application.
  • When upgrading PHP, install the corresponding cURL package or rebuild with the supported libcurl version.
  • After configuration changes, test both CLI and every web SAPI that runs application code.
  • Keep extension directories and Windows DLLs within the same PHP distribution and architecture.
  • Remove temporary diagnostic scripts and avoid exposing phpinfo() publicly.

The durable fix is not a change inside Composer or the application. It is a cURL-enabled PHP runtime, correctly configured for the process that actually executes the failing code.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.