Composer install error - requires ext_curl when it's actually enabled

Composer install error - requires ext_curl when it's actually enabled

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Composer install error - requires ext_curl when it's actually enabled

You've verified that curl is enabled in your php.ini. You've checked phpinfo() and see the extension listed. Yet, when you run composer install, the dependency resolver throws a hard stop claiming ext-curl is missing. This discrepancy between what PHP reports to you and what Composer sees is a classic environment configuration issue, specifically common on Windows setups like WAMP or MAMP.

The root cause lies in how Composer determines which extensions are available. Composer does not rely solely on the global php.ini file located in your installation directory. Instead, it queries the PHP executable that matches its own runtime context. If you have multiple PHP versions installed (which is standard practice) or if you are invoking a different PHP binary than the one Composer expects to use for HTTP requests, this mismatch occurs.

When Composer runs, it often uses a specific PHP binary located in your system path or within its own installation directory. That specific binary might not have the curl extension loaded, even if your main development server (the one you run phpinfo() with) has it enabled. On Windows, this is frequently because the php-curl.dll file exists but isn't being loaded by the specific PHP executable Composer invokes.

To resolve this, you need to ensure that the exact PHP binary Composer uses also loads the extension. Here is the diagnostic workflow:

First, identify which PHP version and path Composer is actually utilizing. Run the following command in your terminal:

php -r "echo 'Path: ' . \PHP_BINARY . PHP_EOL;"

This outputs the full path to the executable. Now, check if that specific binary has curl loaded:

path_to_composer_php -m | findstr curl

If this command returns nothing, but your main php -m does, you have confirmed the mismatch. The solution involves modifying the configuration for that specific PHP instance.

In a WAMP environment, you likely have multiple copies of php.ini. You need to uncomment the extension=curl.dll line in the php.ini file corresponding to the PHP version Composer is using. If you are running PHP 7 or later via Composer's global installation, you might need to edit the php.ini located in your WAMP folder (e.g., wamp\bin\php\phpX.X.X\php.ini) rather than the one in your project root or another version directory.

Another common pitfall is missing dependencies for the extension itself. The curl extension relies on system libraries like OpenSSL, zlib, and libssh2. If these DLLs are not present in the same directory as the PHP executable or are not registered in the Windows System PATH, PHP will fail to load them even if the line is uncommented in php.ini.

You can verify this by attempting to force a reload of extensions without restarting WAMP:

path_to_composer_php -d extension=curl.dll -m

If you see curl in the output, Composer should now be able to resolve the dependency. If not, check the php-error.log or run the PHP executable directly with -i to see any missing DLL warnings.

Sometimes, simply restarting the WAMP server is insufficient if the environment variables are cached or if the PATH needs refreshing. Ensure that the directory containing php-curl.dll and its dependencies is included in your Windows System PATH.

If you are managing a team or deploying this setup, relying on system-wide changes can be fragile. A more robust approach for modern PHP versions (8.1+) is to use PECL or Composer itself to manage extensions via the composer require --dev php-http/curl-client if you specifically need HTTP clients, though for standard SDK installs, getting the native extension right is preferred.

If you find yourself repeatedly hitting this wall on Windows, consider switching your development environment to a containerized setup using Docker. Containers abstract away these DLL path and configuration headaches by bundling the exact PHP environment required by Composer into the image. This ensures that ext-curl is always present and loaded correctly, removing the ambiguity between the CLI tool used for scripting and the one used for dependency management.

For Laravel projects specifically, this issue is less common in production environments but can persist on local Windows development stacks. If you are building a Laravel application and facing this error, ensure your composer.json does not lock an older PHP version that lacks the extension support. Always align your php.ini modifications with the specific PHP binary path identified by Composer to avoid runtime failures where one environment works but dependency installation fails.

Our network