phplaravelcomposer-phpkali-linux

Creating Laravel project on Kali Linux 2022.3 kept failing


I am currently using Kali Linux 2022.3, PHP version 8.1.5 and Composer version 2.4.2.

I am trying to create a Laravel Project using.

composer create-project laravel/laravel example-app

But It kept failing. The error is.

https://repo.packagist.org could not be fully loaded (The "https://repo.packagist.org/p2/laravel/laravel.json" file could not be downloaded: php_network_getaddresses: getaddrinfo for repo.packagist.org failed: Temporary failure in name resolution
Failed to open stream: php_network_getaddresses: getaddrinfo for repo.packagist.org failed: Temporary failure in name resolution), package information was loaded from the local cache and may be out of date.

How do I solve this? I am very new to Kali Linux and not even sure what is causing the error. At first I thought it's connection problem so I tried with VPN and also tried a couple of possible solution but nothing seem to be working.Still the same problem.


Solution

  • This has occurred because of your poor internet connection. make sure you have active internet connect. to check ping google.com should successfully receive network packets. if packets are received successfully, you can create a Laravel project using composer(1).

    You can also create a Laravel project based on various versions via composer command if you have active internet connection on your (Linux) environment. Following commands will help you to create project based on specific version:

    php composer.phar create-project laravel/laravel:9.* project_name
    php composer.phar create-project laravel/laravel:8.* project_name
    php composer.phar create-project laravel/laravel:7.* project_name
    php composer.phar create-project laravel/laravel:6.* project_name
    php composer.phar create-project laravel/laravel:5.* project_name