The error you're encountering is related to SSL certificate verification when Composer tries to download packages. This is a common issue on Windows systems where the local certificate authority (CA) file is not properly configured. Here are the steps to resolve this issue:
-
Download the CA Certificate:
- Download the
cacert.pemfile from the official cURL website: cacert.pem.
- Download the
-
Configure PHP to Use the CA Certificate:
- Locate your
php.inifile. This file is usually found in your PHP installation directory. - Open
php.iniin a text editor. - Find the line that starts with
;curl.cainfoand remove the semicolon (;) to uncomment it. - Set the path to the downloaded
cacert.pemfile. For example:curl.cainfo = "C:\path\to\cacert.pem" - Similarly, find the line that starts with
;openssl.cafileand uncomment it, setting the same path:openssl.cafile = "C:\path\to\cacert.pem"
- Locate your
-
Restart Your Command Line or Terminal:
- Close and reopen your command line or terminal to ensure the changes take effect.
-
Try Running the Composer Command Again:
- Run your original command to create a new Laravel project:
composer create-project "laravel/laravel:^10.0" example-app
- Run your original command to create a new Laravel project:
By following these steps, you should be able to resolve the SSL certificate issue and successfully create a new Laravel project using Composer. If the problem persists, ensure that the path to cacert.pem is correct and that there are no typos in your php.ini configuration.