Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →The message means that the PHP runtime handling your command or web request does not have PHP’s cURL extension loaded. Install or enable cURL for that specific PHP installation, restart the process that uses it, and verify through the same SAPI (CLI, Apache, PHP-FPM, IIS, or Composer) that originally failed.
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 actually means
PHP’s cURL functions are provided by the curl extension, which connects PHP to the libcurl library. A server can have the operating-system curl command installed while PHP still reports that cURL is unavailable. Those are separate components.
As an Amazon Associate I earn from qualifying purchases.
The message can appear as “cURL is not installed in your PHP installation,” “Composer says ext-curl is missing,” or “PHP Startup: Unable to load dynamic library curl.” In every case, first determine which PHP executable, configuration file, version, and SAPI produced the error. CLI PHP and the PHP used by Apache, Nginx/PHP-FPM, or IIS often have different versions and different php.ini files.
Identify the failing PHP runtime
Run these commands in the environment where the failure occurs. For a command-line failure, use a terminal on the same machine and user account. For a website failure, inspect the web SAPI instead of assuming it matches CLI.
#1 Best Overall
-
Check the PHP version:
php -v -
Find the configuration files PHP is using:
php --iniRecord both the “Loaded Configuration File” and the “Scan for additional .ini files” directory. An unexpected path or an empty configuration file is a common cause.
-
Check whether the extension is loaded:
php -m | grep -i curlOn Windows, use
php -m | findstr /i curl, or simply runphp -mand inspect the output.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 errorsSpecial offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
To inspect a web request, create a temporary file in the document root containing:
Rank #2
<?php
var_dump(PHP_VERSION, PHP_SAPI, php_ini_loaded_file(), extension_loaded('curl'));
Load that page through the affected site, note the values, and delete the file immediately afterward. A temporary phpinfo() page provides the same configuration detail, but it exposes sensitive server information and should never remain publicly accessible.
Choose the fix for your installation
| Environment | Typical remedy | Important compatibility check |
|---|---|---|
| Debian or Ubuntu package installation | Install php-curl, or a package such as php8.3-curl, then restart the PHP consumer. |
The package must match the PHP minor version actually running. |
| Windows binary | Enable the bundled cURL extension in the active php.ini and make its dependent DLLs available. |
PHP architecture, thread-safety, extension directory, and DLL builds must match. |
| Source build | Compile PHP with --with-curl=DIR against an installed libcurl. |
Headers, libraries, and the libcurl version must satisfy the PHP release. |
| Composer or a framework command | Fix the PHP runtime used by that Composer executable, not merely the web server or another terminal. | Check the executable path and its loaded modules. |
Debian and Ubuntu: install the matching package
Use the distribution’s default PHP
On a system using the distribution’s default PHP stream, install the extension package with:
sudo apt update
sudo apt install php-curl
Package managers normally pull in the appropriate libcurl dependencies. Confirm the result:
php -m | grep -i curl
php --ri curl
The second command displays cURL extension information, including the libcurl version linked to PHP. If it reports that the extension does not exist, the package was installed for a different PHP executable or the shell is selecting another binary.
Use a versioned PHP package when necessary
When multiple PHP minor versions are installed, use the package matching the runtime shown by php -v. For example, PHP 8.3 may require:
sudo apt install php8.3-curl
Do not install an arbitrary versioned package and assume it will load into every PHP version. A module built for one minor version may not load into another. MediaWiki’s current Debian/Ubuntu quickstart also lists php-curl among its APT prerequisites and uses php --ini to locate configuration.
Rank #4
Restart the process that loads PHP
CLI PHP reads the extension the next time you start the command, but a long-running web process must be restarted. Use the service that your server actually runs, for example:
sudo systemctl restart apache2
sudo systemctl restart php8.3-fpm
For Nginx, restart the PHP-FPM service; restarting Nginx alone does not reload the PHP worker. Substitute the installed PHP-FPM version and service name. If you use Apache’s embedded module, restart Apache. Afterward, repeat the check through a web request, not only in the shell.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Windows: enable the bundled extension safely
Find the active php.ini
Run the exact PHP executable used by the failing command:
php --ini
Open the file shown as “Loaded Configuration File.” If the command says that no configuration file is loaded, create or select the correct php.ini for that PHP installation rather than editing a similarly named file elsewhere.
Enable cURL and verify extension_dir
In php.ini, locate the cURL extension line. Depending on the PHP build, it may appear as:
Free tools Windows power users keep installed
One-click scans. No signup required.
extension=curl
Remove a leading semicolon if the line is commented. Some builds use a DLL filename; follow the format already used by the supplied configuration. Check that extension_dir points to the matching installation’s ext directory, for example:
Quick Recap
extension_dir="
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.




