简体   繁体   English

在 Kali Linux 2022.3 上创建 Laravel 项目一直失败

[英]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.我目前使用的是 Kali Linux 2022.3、PHP 8.1.5 版和 Composer 2.4.2 版。

I am trying to create a Laravel Project using.我正在尝试使用创建一个 Laravel 项目。

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.我是 Kali Linux 的新手,甚至不确定是什么导致了错误。 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.起初我以为是连接问题所以我尝试使用 VPN 并尝试了几个可能的解决方案但似乎没有任何效果。仍然是同样的问题。

This has occurred because of your poor inte.net connection.发生这种情况是因为您的互联网连接不佳。 make sure you have active inte.net connect.确保您有活动的 inte.net 连接。 to check ping google.com should successfully receive.network packets.检查ping google.com应该成功接收.network 数据包。 if packets are received successfully, you can create a Laravel project using composer(1) .如果成功接收数据包,您可以使用composer(1)创建一个 Laravel 项目。

You can also create a Laravel project based on various versions via composer command if you have active inte.net connection on your (Linux) environment.如果您的 (Linux) 环境中有活动的 inte.net 连接,您还可以通过 composer 命令创建基于各种版本的 Laravel 项目。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM