PHP cURL error code 60

PHP cURL error code 60

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

Stefan Bogdanescu

Founder & Senior Architect

PHP cURL error code 60

When deploying a PHP environment on Windows, specifically using setups like WAMP to integrate the Amazon SDK, you often encounter a specific SSL handshake failure. The stack trace typically looks like this: cURL error: SSL certificate problem: unable to get local issuer certificate. This corresponds to error code 60 in the cURL library. While the immediate instinct is to point PHP toward a Certificate Authority (CA) bundle, simply adding curl.cainfo = C:\Windows\ca-bundle.crt to your php.ini often fails to resolve the issue if that specific file doesn't exist or isn't correctly generated for your environment.

The core of this problem lies in how Windows handles SSL verification compared to Linux distributions. On Unix-like systems, the CA bundle is usually pre-installed and located at /etc/ssl/certs/ca-certificates.crt. Windows, however, does not ship with a universally agreed-upon, up-to-date certificate store accessible via a single file path by default. The script referenced in similar troubleshooting scenarios—mk-ca-bundle.vbs—attempts to aggregate certificates from various sources into a .crt file. If you are manually creating this file or relying on an outdated ca-bundle.crt, the cURL engine cannot find the root certificate required to validate the Amazon AWS endpoint's SSL certificate chain.

The most robust solution involves bypassing the manual creation of CA bundles and leveraging the native Windows certificate store, which is already populated with trusted roots provided by Microsoft and other authorities. Instead of configuring curl.cainfo in php.ini, you should use the cURL option to explicitly point to the system's default certificate store.

You can achieve this by modifying your PHP code or passing options when initializing the curl handle. If you are using the AWS SDK for PHP, the underlying RequestCore class wraps these calls. While you cannot always directly edit the internal SDK logic without altering vendor files, you can configure the global cURL context to prioritize the system store.

A more direct approach for application-level control is adding the following line to your code before making requests:

curl_setopt($ch, CURLOPT_CAINFO, 'C:/Windows/System32/drivers/etc/ssl/ca-bundle.crt');

However, this path may vary depending on your specific Windows installation. A more reliable method that works across most modern Windows versions without needing to locate a custom .crt file is to tell cURL to use the default system trust store:

curl_setopt($ch, CURLOPT_CAINFO, 'C:/Windows/System32/drivers/etc/ssl/ca-bundle.crt'); 
// OR, if the above path doesn't exist on your system, use the default behavior by omitting CAINFO
// But for code-level fixes, ensuring the correct bundle exists is key.

If you prefer a configuration-only fix without altering code, ensure that curl.cainfo in php.ini points to an existing file. You can generate a valid certificate bundle using PowerShell or download the official Mozilla root certificates directly to a known location like C:\ProgramData\ca-bundle.crt. Then update php.ini:

curl.cainfo = "C:/ProgramData/ca-bundle.crt"

Restarting the WAMP service is mandatory after changing php.ini, as PHP loads this configuration file only at startup. A common pitfall is assuming that the VBS script mentioned in older tutorials will always produce a compatible bundle; these scripts often rely on specific versions of Windows or outdated certificate lists. Always verify that the file path exists and contains the latest root certificates before expecting the SSL handshake to succeed.

Another consideration involves the version of OpenSSL used by your PHP build. If your PHP installation is compiled against an older version of OpenSSL (pre-1.0.2) that lacks support for certain modern certificate formats or extensions, error code 60 may persist even with a correct CA file. In such cases, recompiling PHP with a newer OpenSSL library or using a pre-compiled binary from a trusted vendor is necessary.

For developers working on shared hosting or managed Windows environments where you cannot modify php.ini or system paths, the only viable option is to ensure your application code handles the certificate verification explicitly or uses an alternative HTTP client library that abstracts these low-level cURL complexities. While tools like Guzzle often wrap cURL and handle some of these defaults internally, they can still inherit configuration issues from the underlying PHP build.

Understanding the distinction between local issuer certificates and the system trust store is crucial when debugging SSL issues on Windows. By aligning your curl.cainfo setting with an actual, populated certificate file—or by configuring cURL to trust the default system store—you eliminate the ambiguity that causes the "unable to get local issuer certificate" error.

Our network