Introduction
I recently tried to create a new Laravel project on my Windows PC and immediately ran into an annoying SSL certificate error, something that I had never come across before. As soon as I typed laravel new project_name
command on the terminal, I faced this weird SSL Certificate Error when creating a new Laravel project!
In this blog post, I’ll share the exact error I faced and the simple yet effective solution that worked for me.
The Problem: SSL Certificate Error When Creating a Laravel Project
While attempting to create a new Laravel project using either of the following commands:
composer create-project --prefer-dist laravel/laravel project_name
and
laravel new project_name
I encountered the (same) following error on my terminal:
[Composer\Downloader\TransportException]
curl error 60 while downloading https://repo.packagist.org/p2/laravel/laravel.json: SSL certificate problem: unable
to get local issuer certificate
I did a little digging around and found that this error occurs when Composer is unable to verify the SSL certificate from Packagist, Laravel’s package repository. I was a little confused, honestly.
The Cause: AVG Antivirus Blocking Composer’s SSL Verification
However, after some troubleshooting, I discovered that my AVG antivirus software was interfering with Composer’s ability to verify SSL certificates. Turns out, many modern antivirus programs have built-in web protection features that scan HTTPS requests, and this was causing unexpected issues with development tools.
The Solution: Temporarily Disabling AVG Antivirus
To fix the issue, all I did was I temporarily disabled AVG antivirus while running the Laravel installation commands, and voila! This time it worked, absolutely without any issues.
Here’s what I did:
How to (Temporarily) Disable AVG Temporarily:
- Open AVG Antivirus:
- Clicked on the AVG icon in the system tray (bottom-right corner of the screen) or searched for AVG in the Windows Start menu.
- Disable Web Protection:
- Navigated to Menu > Settings > Basic Protection > Web & Email Protection.
- Temporarily turned off HTTPS scanning.
Once the antivirus was disabled, all I did was re-ran the command on the terminal.
- Ran the Laravel Installation Command Again:
- Opened my terminal and ran:
composer create-project --prefer-dist laravel/laravel project_name
- If using Laravel installer:
- laravel new project_name
- Opened my terminal and ran:
- Re-enabled AVG Antivirus:
-
Once Laravel was installed successfully, I went back to AVG settings and turned Web Protection back on to keep my system secure.
-
Why This Works
AVG (and other antivirus software) often perform deep packet inspection for SSL traffic, which can interfere with development tools like Composer. By disabling HTTPS scanning temporarily, I allowed Composer to verify the SSL certificate properly and download Laravel without any issues.
Conclusion
If you’re facing the curl error 60
issue while creating a new Laravel project, try temporarily disabling AVG antivirus first. This quick fix worked for me, and it might work for you too.
Have you faced a similar issue? Let me know in the comments what solutions worked for you!