If you’ve ever tried running Composer and got hit with the dreaded error:
Curl error 60: SSL certificate problem: unable to get local issuer certificate
You’re not alone. I ran into this issue recently and, after some troubleshooting, found out the culprit was none other than my antivirus software.
The Culprit? Antivirus HTTPS Scanning
Many modern antivirus programs include a feature that scans HTTPS traffic to detect potential threats. While this is generally a good thing, it can sometimes interfere with tools like Composer, which rely on secure connections to download dependencies.
How I Fixed It
After a lot of trial and error (and frustration), I found two ways to resolve this issue:
1. Temporarily Disable Your Antivirus
One quick way to check if your antivirus is causing the issue is to temporarily disable it and then run Composer again.
- If Composer starts working without errors, you’ve found the problem!
- Of course, leaving your antivirus off isn’t ideal, so let’s move to a more permanent fix.
2. Disable HTTPS Scanning in Your Antivirus
Instead of turning off your entire antivirus, you can disable just the HTTPS scanning feature. The steps will vary depending on which antivirus software you’re using, but here’s a general guide:
For Avast Antivirus:
- Open Avast and go to Settings.
- Navigate to Protection > Core Shields.
- Look for Enable HTTPS Scanning and turn it off.
- Save your settings and try running Composer again.
If you’re using a different antivirus, check its settings for a similar HTTPS scanning or web shield option and disable it.
Alternative Fix: Update Your CA Certificates
If you prefer not to mess with your antivirus settings, you can try updating Composer’s CA certificates manually:
- Download the latest
cacert.pem
file from https://curl.se/ca/cacert.pem. - Find your PHP installation directory and locate
php.ini
. - Open
php.ini
and look for this line:;curl.cainfo =
- Change it to:
curl.cainfo = "C:\path\to\cacert.pem"
(ReplaceC:\path\to\cacert.pem
with the actual location where you saved the file.) - Restart your terminal and try running Composer again.
Final Thoughts
Dealing with SSL certificate errors can be frustrating, but in most cases, the fix is straightforward. If you’re getting this error while using Composer, check your antivirus settings first—it might just be the HTTPS scanning feature causing the issue.
Let me know in the comments if this helped, or if you found another way to fix it! 🚀