1、安装项目出现的问题
# 问题代码:
D:\PHPSTUDY\PHPTutorial\WWW\LaravelStudy20211215>composer create-project laravel/laravel=7.25.0 --prefer-dist ./
Creating a "laravel/laravel=7.25.0" project at "./"
https://repo.packagist.org could not be fully loaded (curl error 28 while downloading https://repo.packagist.org/packages.json: Operation timed out after 10005 milliseconds with 0 out of 0 bytes received), package information was loaded from the local cache and may be out of date
[Composer\Downloader\TransportException]
curl error 28 while downloading https://repo.packagist.org/p2/laravel/laravel.json: Operation timed out after 30001
0 milliseconds with 0 out of 8447 bytes received
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--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] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package>] [<directory>] [<version>]
解决方式:
# 连续运行以下的三行代码之后再重新创建Laravel项目就成功了
composer config -l -g
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer config -g --unset repos.packagist