Curl Error 23 When Running composer install in Laravel Project with Filament CMS.

Updated: Feb 19, 2025

Curl Error 23 When Running composer install in Laravel Project with Filament CMS.

Curl Error 23 is a common issue that can occur when running composer install in a Laravel project that uses Filament CMS. This error is caused by a problem with the cURL library, which is used by Composer to download dependencies.

Here are the steps to resolve the Curl Error 23 issue when running composer install in a Laravel project with Filament CMS:

  1. Check your cURL version: The first step is to check the version of cURL installed on your system. You can do this by running the following command in your terminal or command prompt:

    curl --version
    

    If you have an outdated version of cURL, you may need to update it. You can check the official cURL website (https://curl.se/libcurl/) for the latest version and instructions on how to install it for your operating system.

  2. Check your firewall or antivirus software: Sometimes, firewall or antivirus software can block cURL from making external requests. You may need to add an exception or rule to allow cURL to make requests to the Composer repository.

  3. Use a different cURL library: If the above steps don't work, you can try using a different cURL library. Laravel supports multiple cURL libraries, including libcurl, OpenSSL, and cURL extensions for PHP.

    To use a different cURL library, you need to edit the composer.json file in your Laravel project and add the following line under the require section:

    "platform": {
        "php": ">=7.3.0"
    },
    "config": {
        "curl": "curl.se_allow_redirections:1,curl.max_time:0"
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan config:cache",
            "php artisan key:generate",
            "npm install && npm run dev"
        ],
        "post-update-cmd": [
            "php artisan config:cache",
            "php artisan route:cache"
        ]
    },
    "minimum-stability": "dev"
    

    Then, add the following line under the scripts section:

    "extra": {
        "curl": "ext-curl"
    }
    

    Finally, change the curl library by adding the following line at the beginning of the composer.json file:

    "config": {
        "curl": "openssl"
        // or "curl": "curl" for libcurl or "curl": "php_curl" for cURL extension for PHP
    }
    

    Save the file and run composer install again.

  4. Use a proxy server: If none of the above steps work, you may need to use a proxy server to make the external requests. You can add a proxy server to your .env file by adding the following lines:

    HTTP_PROXY=http://username:[email protected]:port
    SSL_PROXY=http://username:[email protected]:port
    

    Replace username, password, proxy.server, and port with the appropriate values for your proxy server.

    Then, run composer install again.

If none of the above steps work, you may need to seek further assistance from the Laravel or Filament CMS community or consult the official documentation for more advanced troubleshooting steps.