The error you're encountering:
curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate
is not specific to Laravel or Passport, but rather to Composer and your local PHP/cURL setup. It means your PHP installation cannot verify SSL certificates when trying to download packages.
Here's how to fix it:
1. Download the latest cacert.pem
- Go to: https://curl.se/ca/cacert.pem
- Download and save this file somewhere on your computer, for example:
C:\xampp\php\extras\ssl\cacert.pem
2. Update your php.ini
- Open your
php.inifile (usually found atC:\xampp\php\php.ini). - Search for this line:
and change it to:;curl.cainfo =curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem" - Also, find:
and change it to:;openssl.cafile=openssl.cafile="C:\xampp\php\extras\ssl\cacert.pem" - Save the file.
3. Restart Apache
After editing php.ini, restart Apache from the XAMPP control panel so the changes take effect.
4. Try Again
Now, try running your Composer command again:
composer require laravel/passport
Note on Laravel 11 Compatibility
As of early 2024, laravel/passport is compatible with Laravel 11, but always check the official Passport repo for the latest version and compatibility notes.
Summary:
This is a local SSL certificate issue with Composer/PHP, not a Laravel or Passport bug. Download the latest cacert.pem, update your php.ini, and restart Apache. This should resolve your issue.