我输入了create-project laravel/laravel "foldername"
并收到以下消息:
[Composer\Downloader\TransportException] "http://packagist.org/p/illuminate/console%241d2f57f687204b9a57e5848fe9f49e79bc2fb7ed0cafc6d1387ad4760a1b155c.json" 无法下载文件(找不到 HTTP/1.1 404(
这是干什么用的?我已经得到了 laravel 结构文件,但我不想在不知道此错误是什么的情况下继续。
更新:作曲家.json内容在我的Laravel文件夹结构下
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
作曲家身上添加这个:
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{ "packagist": false }
]
并再次运行作曲家更新。如果没有,则运行composer self-update
这在Linux上对我有用。它优先考虑ipv4而不是ipv6。
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
你需要 php curl 模块才能正常工作。
检查您是否有 php-curl 和 php -m
如果列表中不存在 Curl,请使用 (debian( 安装它,apt install php***-curl
将 *** 替换为您的 PHP 版本
apt install php7.4-curl
适用于安装了 PHP 7.4 的 Debian。
安装 curl php 模块后重试,瞧