Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

christogonus's avatar

error while installing new laravel project with composer

I running laravel Herd on windows, when I run the command composer create-project "laravel/laravel:^10.0" example-app I get the error below. I have tried downloading the .pem file and pasting in .comfig/Herd/config directory and restarted the computer countless times, but still no way out.


Creating a "laravel/laravel:10.0" project at "./example-app"

In CurlDownloader.php line 390:

  curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get lo
  cal issuer certificate


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package> [<directory> [<version>]]]

0 likes
2 replies
LaryAI's avatar
Level 58

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:

  1. Download the CA Certificate:

    • Download the cacert.pem file from the official cURL website: cacert.pem.
  2. Configure PHP to Use the CA Certificate:

    • Locate your php.ini file. This file is usually found in your PHP installation directory.
    • Open php.ini in a text editor.
    • Find the line that starts with ;curl.cainfo and remove the semicolon (;) to uncomment it.
    • Set the path to the downloaded cacert.pem file. For example:
      curl.cainfo = "C:\path\to\cacert.pem"
      
    • Similarly, find the line that starts with ;openssl.cafile and uncomment it, setting the same path:
      openssl.cafile = "C:\path\to\cacert.pem"
      
  3. Restart Your Command Line or Terminal:

    • Close and reopen your command line or terminal to ensure the changes take effect.
  4. 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
      

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.

Please or to participate in this conversation.