PHP error guide
cURL error 60 SSL certificate problem: meaning and fix
Error summary
Install a current CA bundle and configure curl.cainfo when PHP cannot find the system trust store. Libcurl cannot build a trusted certificate chain for the peer.
What it means
Install a current CA bundle and configure curl.cainfo when PHP cannot find the system trust store. Libcurl cannot build a trusted certificate chain for the peer.
What the error means
This message means that libcurl cannot build a trusted certificate chain for the peer. The exact signature distinguishes curl error 60 ssl certificate problem from a generic application failure.
Why PHP produces it
The engine or service reports “cURL error 60 SSL certificate problem” because its required precondition was not met. Install a current CA bundle and configure curl.cainfo when PHP cannot find the system trust store.
PHP version notes
The curl error 60 ssl certificate problem wording here is based on PHP 7.x–8.4; exception forms require JSON_THROW_ON_ERROR where shown; punctuation and exception class names can differ on older branches or vendor builds.
Most common causes
- The immediate input or configuration reaches the specific condition: libcurl cannot build a trusted certificate chain for the peer
- The code path assumes the prerequisite for curl error 60 ssl certificate problem has already been satisfied.
- For curl error 60 ssl certificate problem, development and production differ in version, extension, permissions, paths, or service configuration.
- An earlier operation returned an unchecked value that is consumed by the line reporting curl error 60 ssl certificate problem.
Minimal examples
BAD — reproduces the problem
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
FIXED — safer pattern
curl_setopt($ch, CURLOPT_CAINFO, "/etc/ssl/certs/ca-certificates.crt");
Step-by-step diagnosis
- Copy the complete “cURL error 60: SSL certificate problem: unable to get local issuer certificate” text and retain the first application stack frame.
- Reproduce curl error 60 ssl certificate problem in the same SAPI and environment listed for this page.
- Before changing curl error 60 ssl certificate problem, inspect the preceding value or directive and verify its type, path, version, and permissions.
- Apply the narrow correction—install a current CA bundle and configure curl.cainfo when PHP cannot find the system trust store—then repeat the original request once.
Fixes
Correct the failing prerequisite
Install a current CA bundle and configure curl.cainfo when PHP cannot find the system trust store
curl_setopt($ch, CURLOPT_CAINFO, "/etc/ssl/certs/ca-certificates.crt");
Fail explicitly at the boundary
Validate the condition before the operation that emits curl error 60 ssl certificate problem, and log a safe diagnostic without credentials or full production paths.
Common mistakes when fixing it
- Suppressing curl error 60 ssl certificate problem instead of correcting its upstream condition.
- Testing curl error 60 ssl certificate problem only with the CLI binary when the failing request runs under FPM or Apache.
- Changing a global setting for curl error 60 ssl certificate problem before confirming the site-specific effective configuration.
How to prevent it
- Add a focused test that exercises the boundary responsible for curl error 60 ssl certificate problem.
- Keep runtime versions, extensions, configuration, and deploy artifacts affecting curl error 60 ssl certificate problem reproducible.
- Validate external data and service return values before they can trigger curl error 60 ssl certificate problem.
Web server / environment notes
cli, fpm, linux. The failure occurs where libcurl cannot build a trusted certificate chain for the peer
Tags: cli,fpm,linux