Free tools Windows power users keep installed
One-click scans. No signup required.
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.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
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.
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.
#1 Best Overall
Check command-line PHP
- Display the PHP version and build:
php -v. - Show the configuration files PHP searches and loads:
php --ini. Note both the “Loaded Configuration File” and the “Scan for additional .ini files” directory. - Check whether cURL is loaded:
php -m | grep -i curl. On Windows, usephp -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:
<?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.
Rank #2
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:
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.
Use the configuration file reported by PHP
- Run the failing PHP executable with
php --ini, or use the temporary web diagnostic page if the failure is in a browser. - Open the reported
php.iniwith administrative permission if it is under a protected installation directory. - Find the cURL extension entry. Remove its leading semicolon if present. Depending on the PHP build, the line may be written as
extension=curlorextension=php_curl.dll. - Check that
extension_dirpoints to theextdirectory belonging to that same PHP installation. Do not point a 64-bit build at another installation’s extensions. - 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.
Rank #4
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.
- Install a libcurl development package, not only a runtime package, so the headers and linker files are present.
- Choose a libcurl release supported by your PHP version. The PHP manual lists minimum versions that vary by release.
- Configure PHP with
--with-curl=DIR, whereDIRidentifies the libcurl installation, then rebuild and install PHP using your normal build procedure. - Run
php --ri curlwith 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.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.Verify the repair through the same SAPI
Use more than one check when the failing application is not the terminal:
php -mshould listcurl.php --ri curlshould display cURL extension information and its linked libcurl details.php -r 'var_dump(extension_loaded("curl"));'should outputbool(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.
Recommended Free Tools
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.
- Record the CLI version and configuration with
php -vandphp --ini. - Record the web version, SAPI and configuration path with
php_ini_loaded_file()andPHP_SAPI. - Install or enable cURL for the web version, not merely for the CLI version.
- Restart the web server or the exact FPM service serving the site.
- 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.
- From the project environment, run
php -v,php --iniandphp -m | grep -i curl(or the Windows equivalent). - If cURL is absent, install the matching Linux package, enable the Windows module, or rebuild PHP with
--with-curl. - Restart any service or shell integration that supplies a different PHP binary, then repeat
php --ri curl. - Run Composer again from the same account and environment that originally reported
ext-curlas 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.
Outdated 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 matchWindows 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 reinstallKeep 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.
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.




