Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › curl

How to Enable PHP cURL So WordPress Plugins Work Correctly

By Freedom251 Team · · 10 min read

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

If a WordPress plugin cannot contact an update server, API, payment gateway, or license service, enable PHP’s cURL extension in the PHP runtime that serves your website. Confirm that runtime’s libcurl and SSL support, reload PHP or the web server, then retest the plugin. Installing the command-line curl program alone does not enable PHP cURL.

What PHP cURL does for WordPress

PHP cURL is an extension that exposes cURL functions to PHP applications. It uses the libcurl library underneath. WordPress and many plugins use it to make outbound HTTP and HTTPS requests to remote services, including update servers, REST APIs, payment providers, license systems, and webhook endpoints.

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.

WordPress routes remote requests through its HTTP API rather than requiring every plugin to implement a transport itself. The API uses WordPress’s native transports first and can fall back to cURL when necessary. WordPress lists cURL as a highly recommended extension because its presence improves compatibility with plugins and themes and supports remote-request operations.

The WordPress core cURL transport needs both curl_init() and curl_exec(). For HTTPS requests, the cURL build must also include SSL support. If a plugin reports Call to undefined function curl_init(), the extension is unavailable to the PHP process handling that request, even if a shell command named curl works on the server.

Check the PHP runtime before changing anything

The most common configuration mistake is enabling cURL for command-line PHP while the website runs a different PHP installation through PHP-FPM, Apache, or another web-server integration. Identify the web runtime first.

  1. Use your hosting panel’s PHP version or extensions screen. Note the PHP version assigned to the domain, not merely the version shown by a terminal command.
  2. If the panel is unclear, inspect the web runtime temporarily. Create a protected page containing <?php phpinfo(); ?>, restrict it by access control or a hard-to-guess URL, and open it through the website. Record the PHP version, loaded configuration file, additional parsed files, and the cURL section. Delete the page immediately after checking it.
  3. Look for the cURL module and libcurl version. A loaded module normally shows a cURL section with its libcurl version and SSL details. The exact labels vary by PHP build.
  4. Compare web and command-line PHP only as a diagnostic. In a shell, php -m | grep -i curl (Linux and macOS) or php -m | findstr /I curl (Windows) shows the CLI module. php -r 'var_dump(curl_version());' prints the CLI build’s libcurl information. These results do not prove that the web runtime is configured the same way.

If cURL appears in the terminal but not in the web-runtime report, enable it for the web PHP installation or change the site to the intended PHP handler. Do not assume that restarting a shell, changing a user-level setting, or installing a command-line utility changes PHP-FPM or Apache.

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

Confirm the libcurl version and SSL requirements

PHP’s documented minimum libcurl versions depend on the PHP release. These are minimum compatibility floors, not a recommendation to run an old library.

PHP context Minimum libcurl version documented by PHP What to do
General PHP requirement 7.10.5 Use a package supplied by the operating system or host that meets the floor.
PHP 7.3 and later 7.15.5 Check the library linked to the active web PHP build.
PHP 8.0 and later 7.29.0 Upgrade the host package if the linked library is older.
PHP 8.4 and later 7.61.0 Verify the PHP 8.4 build and its linked libcurl together.

The WordPress Hosting Handbook recommends a system cURL package at version 8.4 or newer for current hosting, while the PHP figures above are minimums. A module can therefore be loaded and still be unsuitable if its underlying library is too old or lacks SSL support.

Enable cURL on managed WordPress hosting

On managed hosting, you may not have permission to install PHP packages or edit the server-wide configuration. Use the host’s control panel first.

  1. Open the domain’s PHP version, PHP extensions, or similarly named settings page.
  2. Select the PHP version actually assigned to the WordPress site.
  3. Enable the extension labeled curl or PHP cURL. Save or apply the change.
  4. If the panel offers separate PHP handlers, apply the extension to PHP-FPM, Apache, or the handler shown for the domain rather than to CLI PHP.
  5. Use the protected phpinfo() check or WordPress Site Health to confirm that the web request now loads cURL.
  6. Retry the plugin’s update, API, license, or connection operation.

If no extension control exists, open a support request with the site’s domain, PHP version, and the exact error. Ask the host to enable PHP cURL and verify libcurl SSL support in the web runtime. Managed hosts often package PHP themselves, so a generic operating-system command may not affect the service that serves your site.

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

Enable cURL on a Linux server

On a self-managed Linux server, install the cURL extension package that matches the PHP version used by the website. Package names and service names differ between distributions and between PHP versions, so select the package from your distribution’s repository or hosting panel rather than copying a package for another version.

  1. Identify the web PHP version and handler from the virtual-host configuration, PHP-FPM pool, or the web-runtime report.
  2. Use the distribution package manager to install or enable the matching PHP cURL package. On some systems the package is named generically, such as php-curl; versioned repositories may use a name tied to the PHP release. Treat those names as examples and confirm the correct package for your system.
  3. Check the package manager’s output for a libcurl dependency and make sure it meets the PHP release’s minimum.
  4. Reload the PHP handler and, when required by the server configuration, reload the web server. A newly installed module is not available to existing PHP-FPM workers until they are replaced.
  5. Verify the module through the website, not only with the CLI command. Confirm the cURL section, libcurl version, and SSL support.

Do not install a random DLL or copy libraries from an unrelated PHP build. PHP extensions must match the PHP major and minor version, architecture, thread-safety model, and runtime used by the site.

Enable cURL in php.ini

Editing php.ini works only when you edit the configuration file read by the web runtime. The CLI configuration file may be different.

  1. Find the active file in the web-runtime phpinfo() report. Check both Loaded Configuration File and Additional .ini files parsed.
  2. Open the relevant file with administrator permissions and search for the cURL extension directive. Depending on the build, it may appear as a generic cURL extension entry or as a Windows DLL entry.
  3. If the directive is present but begins with a semicolon, remove that leading semicolon to uncomment it. Do not create a second conflicting directive.
  4. Save the file and reload PHP-FPM or the Apache PHP integration. If a control panel manages PHP, use its restart or reload function instead of editing a generated file that will be overwritten.
  5. Recheck the web-runtime report. If cURL is still absent, inspect the PHP error log for a module-load error such as a missing dependency, wrong architecture, or incompatible extension.

A restart is part of the change: PHP workers normally read extension settings when they start, not on every request.

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

Enable cURL on Windows PHP

PHP’s Windows documentation states that cURL support is built with --with-curl. A Windows PHP installation also needs the documented OpenSSL components (or the newer libcrypto/libssl equivalents) and libssh2 DLLs available through the system PATH when the build requires them.

  1. Confirm that the website and command line are using the same Windows PHP directory. IIS, Apache, PHP-FPM-compatible services, and scheduled tasks can point to different installations.
  2. Open the php.ini used by the web process and locate the cURL extension entry. On many Windows builds it references php_curl.dll; use the directive supplied with that PHP distribution.
  3. Remove the leading semicolon if the entry is disabled, then save the file.
  4. Ensure the required OpenSSL and libssh2 DLLs are available in the PHP directory or another directory on the service account’s PATH, as required by that build.
  5. Restart the web server or PHP service and verify cURL through a web-runtime report.

The PHP manual says that downloading a separate libcurl.dll from curl.se is not required for Win32 PHP. Use the DLLs and dependencies supplied or documented for the PHP build instead of mixing files from unrelated packages.

Reload services and verify the result

After enabling the module, verify the exact runtime WordPress uses before testing the plugin.

  • Module: the web-runtime report contains a cURL section, or Site Health reports the extension as available.
  • Functions: a small protected diagnostic can test function_exists('curl_init'); remove the diagnostic after use.
  • Library: the reported libcurl version meets the requirement for the installed PHP release.
  • HTTPS: the cURL build reports SSL support. Without it, HTTPS requests cannot complete securely.
  • Service state: PHP-FPM, Apache, or the relevant web handler was reloaded after the configuration change.

Once verification succeeds, reopen the plugin screen and repeat the operation that failed. An update, license check, or API call may be cached by the plugin, so follow its own retry or refresh control rather than assuming that loading the settings page repeats the request.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Separate a missing extension from a network failure

Enabling cURL solves only the PHP capability problem. A plugin can still fail after the extension loads because the remote connection is blocked or the remote service rejects the request.

Observed symptom Likely category Checks and next action
Call to undefined function curl_init() PHP cURL is missing, disabled, or loaded in a different runtime Inspect the web PHP runtime, enable the matching extension, reload the handler, and verify again.
cURL appears in CLI PHP but not in Site Health or a web report CLI and web configurations differ Use the web runtime’s php.ini and service, not the CLI configuration.
DNS or “could not resolve host” error Resolver or network configuration Check the server’s DNS settings, outbound policy, hostname spelling, and whether the host can resolve the endpoint.
TLS, certificate, or SSL verification error Certificate chain, CA store, hostname, clock, or SSL-enabled cURL issue Confirm SSL support, the server clock, CA certificates, and the endpoint’s certificate. Do not disable certificate verification as a permanent workaround.
Connection timeout or refused connection Firewall, proxy, routing, remote port, or remote outage Check outbound firewall rules, proxy requirements, hosting restrictions, and the service’s availability.
HTTP 401 or 403 Authentication or authorization Verify the plugin’s credentials, license key, API permissions, and any proxy or web-application rules.
HTTP 404, 429, or 5xx Endpoint, rate limit, or remote-service problem Confirm the endpoint configured by the plugin, respect rate limits, and check the provider’s status or support channel.

WordPress’s debug log and Site Health can provide the next useful clue. Record the complete error, the endpoint domain, the PHP version, and whether the failure occurs for every plugin or only one. Avoid publishing API keys, license tokens, authorization headers, or full request URLs that contain secrets.

What plugin developers should use instead of direct cURL calls

The WordPress Plugin Handbook recommends WordPress’s HTTP API instead of creating bespoke cURL calls. Use wp_remote_get(), wp_remote_post(), or the related HTTP API functions for plugin requests.

  • WordPress can choose an available transport and fall back to cURL when necessary.
  • The API provides consistent handling for redirects, timeouts, SSL verification, and response objects.
  • Plugins can inspect errors with is_wp_error() and handle HTTP status codes without duplicating transport logic.
  • Site administrators can apply WordPress-level HTTP settings and filters more consistently than they can with unrelated direct cURL implementations.

A third-party library may require direct cURL, but that should be an explicit dependency with a clear failure message. A plugin should not assume that the shell curl executable is available, and it should not silently turn off TLS verification to make a request pass.

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

A reliable troubleshooting sequence

Use this order when a plugin still reports that cURL is unavailable:

  1. Copy the exact error and identify whether it is an undefined PHP function or a connection/HTTP error.
  2. Confirm the PHP version and handler serving the WordPress request.
  3. Inspect that runtime for the cURL module, its libcurl version, and SSL support.
  4. Enable the matching extension through the host panel, package manager, or active php.ini.
  5. Reload PHP-FPM, Apache, or the applicable web service.
  6. Verify again through Site Health or a temporary protected web-runtime report.
  7. Retry the plugin operation and inspect the WordPress debug log if it fails.
  8. If the module is loaded, investigate DNS, TLS, firewall, proxy, timeout, authentication, HTTP status, and remote-service availability separately.

This sequence prevents a common diagnostic loop: repeatedly reinstalling cURL when the extension is already loaded and the real problem is a blocked outbound connection or an invalid remote response.

Key distinctions to remember

  • PHP cURL is an extension; the command-line curl executable is a separate layer.
  • The web PHP runtime matters more than CLI PHP because that is where WordPress executes.
  • PHP cURL depends on libcurl, and HTTPS additionally requires SSL support in the cURL build.
  • An undefined curl_init() function indicates that the extension is unavailable to that runtime; enabling it may require a host administrator and a service reload.
  • Once cURL loads, network, TLS, firewall, proxy, authentication, timeout, and remote-server failures require their own diagnosis.

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.

curlPHPplugin troubleshootingWeb hostingWordPress

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.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.