Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
To make WordPress plugins that contact update servers, APIs, payment gateways, or license services work, enable PHP’s cURL extension in the PHP runtime that serves your website, make sure its underlying libcurl build supports HTTPS, reload the PHP/web service, and then test the same runtime again. Installing or enabling the command-line curl program alone does not enable PHP cURL. If an error says curl_init() is undefined, the extension is unavailable to the web PHP process or has been disabled there.
What cURL does in WordPress
PHP cURL is an extension that gives PHP access to libcurl, the networking library used to make outbound HTTP and HTTPS requests. WordPress’s HTTP API uses available transports and can fall back to cURL when it is the appropriate transport. Plugins use that stack for automatic updates, license validation, remote configuration, payment requests, webhooks, cloud storage, analytics, and calls to third-party APIs.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteWordPress lists cURL as a highly recommended PHP extension because remote requests are a normal part of modern plugin and theme operation. Without it, a plugin may fail during activation, report that it cannot reach its service, or silently skip update and license checks. The precise symptom depends on how the plugin handles a missing transport.
There are two different things called cURL:
- PHP cURL extension: loaded by the PHP interpreter running WordPress. It provides functions such as
curl_init()andcurl_exec(). - Command-line cURL: a shell executable you can run from a terminal. It is useful for testing connectivity, but installing it does not load the PHP extension.
Enabling the shell program while leaving the web server’s PHP extension disabled will not fix a WordPress plugin.
#1 Best Overall
Compatibility requirements
PHP cURL depends on libcurl. PHP’s current documentation gives these minimum libcurl versions:
| PHP version context | Documented minimum libcurl | How to interpret it |
|---|---|---|
| PHP versions generally | 7.10.5 | Baseline requirement stated by the PHP manual. |
| PHP 7.3 and newer | 7.15.5 | Use the threshold applicable to this PHP branch. |
| PHP 8.0 and newer | 7.29.0 | Older libcurl builds may not satisfy the extension’s requirements. |
| PHP 8.4 and newer | 7.61.0 | Check the operating system package rather than assuming the system library is current enough. |
The WordPress Hosting Handbook recommends a system cURL package at version 8.4 or newer for optimal operation and compatibility. That recommendation is not the same as PHP’s minimum ABI requirement: a host can meet PHP’s minimum while still using an older package than WordPress recommends. Ask the host which libcurl build is linked to the PHP runtime if you cannot inspect it yourself.
For HTTPS, WordPress’s cURL transport also requires a cURL build with SSL support. A module can appear in a list yet still be unusable for secure requests if the linked library lacks working TLS support or the server has no usable certificate-authority bundle.
Identify the PHP runtime that actually serves WordPress
The first troubleshooting mistake is checking the wrong interpreter. A terminal command such as php -m reports the CLI PHP binary selected for your shell. WordPress may instead run through PHP-FPM, Apache’s PHP module, or a hosting panel’s separate PHP version. Those runtimes can have different versions, configuration files, extensions, and libcurl libraries.
- Check the site’s selected PHP version. In your host’s PHP selector, note the version assigned to the domain. On a self-managed server, identify whether the virtual host uses PHP-FPM, Apache’s module, or another handler.
- Create a temporary diagnostic page only when necessary. A protected page containing
<?php phpinfo(); ?>displays the web runtime’s loaded modules, configuration file path, and cURL section. Restrict access, use it briefly, and delete it immediately after recording the details because phpinfo exposes server configuration. - Confirm the cURL section. Look for a loaded cURL module, the libcurl version, SSL support, and the “Loaded Configuration File” path. If there is no cURL section, the extension is not loaded by that web runtime.
- Compare with CLI results only as a secondary check. On a shell,
php --ri curlorphp -m | grep -i curlshows the CLI configuration. Treat a positive CLI result as irrelevant until the web runtime also reports cURL.
A protected diagnostic page is safer than leaving a public phpinfo() file in the document root. If your host does not permit temporary files, ask support to confirm the web PHP version, cURL module, libcurl version, and SSL support from their server-side tools.
Recognize a missing-extension error
An error such as Call to undefined function curl_init() is a strong indicator that PHP cURL is not available to the runtime executing that code. The cause can be a missing package, a disabled directive, a PHP-version mismatch, or a hosting policy that blocks the extension. Installing an unrelated command-line package will not change this error.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #2
Other messages point to a different layer. “Could not resolve host” indicates DNS or resolver trouble. Certificate-verification failures indicate TLS trust, hostname, clock, or certificate-chain problems. Connection timeouts and refused connections usually involve firewall rules, proxies, routing, or an unavailable remote service. HTTP 401 or 403 responses indicate authentication or authorization, not a missing extension.
Enable cURL on Linux or package-managed hosting
On a self-managed Linux server, install the PHP cURL package that matches the PHP minor version used by the WordPress site. Package names vary by distribution and by whether PHP came from the distribution repository or a third-party repository.
| Environment | Typical action | Important qualification |
|---|---|---|
| Debian or Ubuntu | Install the matching package, for example sudo apt install php8.3-curl, replacing 8.3 with the site’s PHP version. |
The generic php-curl package may be correct on some releases; verify the package’s PHP dependency before installing. |
| RHEL, Fedora, or compatible systems | Use the enabled repository’s package manager, commonly sudo dnf install php-curl. |
Multiple PHP streams can exist. Make sure the package belongs to the stream serving the virtual host. |
| Control panel hosting | Use the domain’s PHP-extension selector to enable cURL for the selected PHP version. | Changing a global default may not change the version assigned to the domain. |
| Containerized deployment | Install or compile the extension in the image, then rebuild and redeploy the container. | Changing the host machine does not modify an already-built container image. |
After package installation, reload the service that owns the web runtime. For PHP-FPM this commonly means restarting the PHP-FPM service; for Apache with an embedded PHP module, restart Apache. Nginx normally passes requests to PHP-FPM, so restarting Nginx alone will not reload PHP-FPM’s modules.
Example commands on a system using PHP 8.3 FPM are:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →sudo apt install php8.3-curl
sudo systemctl restart php8.3-fpm
Use the service name shown by your operating system; do not copy the version blindly. A package can be installed successfully while the site continues using another PHP version.
Verify package and service alignment
- Check the PHP version assigned to the domain.
- Install the cURL package for that same version.
- Restart the corresponding PHP-FPM or Apache service.
- Refresh the protected diagnostic page and confirm that cURL appears.
- Retry the plugin operation from the WordPress dashboard.
If the module still does not appear, inspect the service’s configuration path and startup log. A package for PHP 8.3 does not load into PHP 8.2, and a CLI package does not necessarily affect a separate FPM installation.
Enable cURL by editing php.ini
Some installations already contain the cURL extension but leave it disabled in php.ini. The exact directive differs by platform and build. On a Unix-like system it may appear as extension=curl; on Windows it commonly appears as extension=php_curl.dll.
- Use the web runtime’s “Loaded Configuration File” value from phpinfo, or your hosting panel’s PHP-information screen. Do not assume the CLI path is the web path.
- Open that file with administrator privileges and search for
curl. - If the directive is present and begins with a semicolon, remove the leading semicolon to uncomment it. If no directive exists, use the host’s package or extension manager rather than inventing a DLL path.
- Save the file and restart PHP-FPM, Apache, or the service specified by your host.
- Refresh the diagnostic page and confirm both the module and libcurl details.
A configuration edit has no effect until the long-running PHP process reloads. PHP-FPM workers can keep the old configuration in memory, and opcode caching can make a test page appear unchanged until the service is restarted. On managed hosting, users may not have permission to edit the effective file; request that the provider enable PHP cURL for the domain’s PHP version.
Windows PHP requirements
PHP’s Windows builds provide cURL support when PHP is built with --with-curl. In addition to enabling the PHP extension, Windows needs the OpenSSL libraries (or the newer libcrypto/libssl equivalents documented for the PHP build) and the libssh2 DLLs available through the system’s PATH or the PHP directory as required by that build.
- Confirm the PHP version and architecture used by the web server, such as 64-bit versus 32-bit and thread-safe versus non-thread-safe.
- Open the
php.iniused by that web server, not merely the one shown by a command prompt. - Enable the appropriate cURL extension directive, commonly
extension=php_curl.dll. - Make sure the required OpenSSL and libssh2 DLLs match the PHP build and are discoverable through
PATH. - Restart IIS, Apache, or the PHP FastCGI process, then verify cURL in a protected phpinfo page.
The PHP manual states that Win32 PHP does not require downloading a separate libcurl.dll from curl.se. Mixing DLLs from unrelated builds can create startup errors or incompatible dependencies, so use the libraries distributed for your PHP package or hosting stack.
Verify cURL from the web runtime
Once you have enabled the extension and reloaded the service, verify the functions and the linked library before blaming the plugin.
A temporary, access-controlled test script can contain:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
<?php
header('Content-Type: text/plain');
var_dump(PHP_VERSION);
var_dump(function_exists('curl_init'));
if (function_exists('curl_version')) {
print_r(curl_version());
}
The expected result is bool(true) for function_exists('curl_init'), followed by a cURL information array containing a libcurl version and SSL-related feature data. Delete the script after testing. The existence check confirms loading; it does not prove that DNS, outbound firewall rules, certificate validation, authentication, or the remote service are healthy.
WordPress Site Health can also identify missing recommended extensions and configuration problems. After enabling cURL, clear any dashboard notice by revisiting the Site Health screen and retrying the plugin’s update, activation, or API action. If the plugin caches a failed license or update response, follow its documented retry or reconnect control rather than repeatedly activating and deactivating it.
Separate extension problems from network problems
Use the error category to choose the next diagnostic step:
| Symptom | Likely layer | Next check |
|---|---|---|
Call to undefined function curl_init() |
PHP extension unavailable | Confirm the web runtime, package, php.ini directive, and service reload. |
| cURL appears in phpinfo, but HTTPS requests fail certificate verification | TLS trust or certificate chain | Check the CA bundle, system clock, hostname, proxy interception, and the remote certificate. Do not disable verification as a workaround. |
| Could not resolve host | DNS or resolver | Check the server’s resolver configuration and whether the hostname resolves from that server. |
| Connection timed out or was refused | Firewall, routing, proxy, or remote outage | Check outbound policy, proxy settings, destination port, and the remote service status. |
| HTTP 401 or 403 | Authentication or authorization | Verify API keys, license credentials, request headers, account status, and the endpoint’s access rules. |
| HTTP 429 | Rate limiting | Respect the service’s retry guidance and reduce repeated tests. |
| HTTP 5xx | Remote server failure | Record the status and response time, then check the provider’s service status or contact its support. |
| Works in CLI but not in WordPress | Different PHP runtime or policy | Compare the web runtime’s PHP version, extension list, CA path, proxy variables, and outbound permissions. |
Command-line testing can help isolate DNS and routing, but it must target the same destination and use comparable proxy and certificate settings. A successful shell request does not prove that PHP-FPM has the same network permissions or trust store.
Use WordPress’s HTTP API in plugin code
If you are developing or repairing a plugin, prefer WordPress’s HTTP API instead of creating direct cURL calls. The Plugin Handbook says WordPress has an extensive HTTP API that should be used instead of creating your own cURL calls. Functions such as wp_remote_get() and wp_remote_post() let WordPress select an available transport and consistently manage redirects, timeouts, SSL verification, and response handling.
A minimal GET request can look like this:
<?php
$response = wp_remote_get(
'https://api.example.test/status',
array(
'timeout' => 15,
'headers' => array(
'Accept' => 'application/json',
),
)
);
if (is_wp_error($response)) {
error_log($response->get_error_message());
return;
}
$status_code = wp_remote_retrieve_response_code($response);
$body = wp_remote_retrieve_body($response);
For a POST request, provide the body and content type through the API arguments and check both transport errors and the returned HTTP status. Do not treat a non-empty response as success automatically. Validate the status code, parse JSON defensively, and handle malformed or unexpected data.
Direct cURL calls are appropriate only when a required third-party library or protocol specifically demands them. If you use them, set a finite timeout, keep certificate verification enabled, avoid logging credentials, and close every handle. A plugin should not silently disable TLS verification simply because a server has an incomplete CA installation; fix the trust store or report a clear administrator error instead.
Common reasons enabling cURL still appears not to work
The wrong PHP version was changed
A hosting panel may expose several PHP versions. Enabling cURL for the account’s default version does nothing if the domain is pinned to another version. Recheck the domain assignment and the PHP version shown by the web runtime.
PHP-FPM was not restarted
Editing php.ini or installing a package does not reload existing workers. Restart the matching PHP-FPM service, then refresh the diagnostic page. Restarting only Nginx will not reload PHP-FPM’s extension list.
A plugin runs from a different execution context
Scheduled tasks, command-line maintenance commands, and web requests can use different PHP binaries. Test the context that fails. If a cron job invokes a system PHP binary while the site uses a panel-managed PHP-FPM binary, configure the job to use the intended interpreter.
The extension loads but HTTPS trust fails
Confirm that curl_version() lists SSL support and that the server has an up-to-date CA bundle. Check the system clock and any corporate proxy that re-signs TLS traffic. Never “fix” the problem by setting verification to false in production.
A firewall or proxy blocks outbound traffic
Some managed servers restrict outbound connections or require an HTTP proxy. Ask the host whether external HTTPS requests are allowed and whether proxy variables or a panel setting are required. A missing extension and a blocked connection can produce very different logs, so record the exact error.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →The remote endpoint is unavailable or rejecting the request
After cURL is confirmed, inspect the HTTP status, response body, and WordPress debug log. Verify the endpoint URL, credentials, license state, required headers, rate limits, and API version. A remote outage cannot be repaired by reinstalling PHP cURL.
Operational and security checks
- Keep PHP and the operating system’s libcurl package supported and patched.
- Use HTTPS endpoints and leave certificate verification enabled.
- Set finite request timeouts so a plugin cannot stall every page request while a remote server is down.
- Store API keys and license credentials outside publicly accessible files and never write them to debug logs.
- Limit diagnostic pages such as phpinfo to administrators and remove them after use.
- After changing PHP modules, test both the WordPress dashboard operation and any scheduled job that performs remote requests.
- Document which PHP version, configuration file, FPM service, and package supplied cURL so the fix can be repeated after an upgrade.
End-to-end enablement checklist
- Record the plugin’s exact error message and the action that triggers it.
- Identify the PHP runtime serving the affected WordPress site.
- Confirm whether cURL and libcurl appear in that runtime, including SSL support.
- If
curl_init()is undefined, install or enable the matching PHP cURL package or extension. - If using
php.ini, uncomment the cURL directive in the web runtime’s file. - On Windows, verify compatible OpenSSL and libssh2 DLLs and the required
PATHentries. - Reload PHP-FPM, Apache, IIS, or the relevant hosting service.
- Recheck with protected phpinfo output or a temporary function test, then delete the diagnostic file.
- Retry the plugin’s update, API, payment, or license operation.
- If it still fails, classify the error as DNS, TLS, firewall/proxy, timeout, authentication, rate limiting, or remote-service failure and troubleshoot that layer separately.
- If you maintain the plugin, use WordPress’s HTTP API and handle both transport errors and HTTP response codes.
When the web PHP runtime has a working cURL extension, a compatible libcurl library, SSL support, and permission to make outbound connections, WordPress can provide the transport that most remote-dependent plugins expect. Any remaining failure should then be investigated as a network, authentication, configuration, or remote-service issue rather than as a missing PHP extension.
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.

