简体   繁体   English

由作曲家安装 Laravel 5 时出错

[英]Error installing laravel 5 by composer

I'm using windows 7 and trying to install laravel by composer.I've installed composer in my system and added git to my path earlier.I also downloaded a fresh copy of laravel and paste it into my server.Now,when i run this comment to install laravel ,i get this error.我正在使用 windows 7 并尝试通过 composer 安装 laravel。我已经在我的系统中安装了 composer 并较早地将 git 添加到我的路径中。我还下载了 laravel 的新副本并将其粘贴到我的服务器中。现在,当我运行时这个安装laravel的评论,我收到这个错误。

C:\\xampp\\htdocs\\laravel-master>composer install C:\\xampp\\htdocs\\laravel-master>composer 安装

Loading composer repositories with package information使用包信息加载作曲家存储库

Installing dependencies (including require-dev)安装依赖项(包括 require-dev)

  • Installing symfony/var-dumper (v2.7.5)安装 symfony/var-dumper (v2.7.5)

    Downloading: 100%下载:100%

    Downloading: 100%下载:100%

    Downloading: 100%下载:100%

    Failed to download symfony/var-dumper from dist: The http//api.github.com/repos/sym fony/var-dumper/zipball/ba8c9a0edf18f70a7efcb8d3eb35323a10263338 file could not be downlo aded: failed to open stream: A connection attempt failed because the connected party did n ot properly respond after a period of time, or established connection failed because conne cted host has failed to respond.无法从 dist 下载 symfony/var-dumper:http//api.github.com/repos/sym fony/var-dumper/zipball/ba8c9a0edf18f70a7efcb8d3eb35323a10263338 文件无法下载:无法打开流:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机没有响应而建立连接失败。

    Now trying to download from source现在尝试从源下载

    • Installing symfony/var-dumper (v2.7.5) Cloning ba8c9a0edf18f70a7efcb8d3eb35323a10263338安装 symfony/var-dumper (v2.7.5) 克隆 ba8c9a0edf18f70a7efcb8d3eb35323a10263338

[RuntimeException] Failed to clone git@github.com:symfony/var-dumper.git via git, https, ssh protocols, aborting. [RuntimeException] 无法通过 git、https、ssh 协议克隆 git@github.com:symfony/var-dumper.git,正在中止。

  • git://github.com/symfony/var-dumper.git Cloning into 'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'... fatal: unable to connect to github.com: github.com[0: 192.30.252.128]: errno=No error git://github.com/symfony/var-dumper.git 克隆到 'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'... 致命:无法连接到 github.com: github.com[0: 192.30.252.128]: errno=没有错误

  • https://github.com/symfony/var-dumper.git Cloning into 'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'... fatal: unable to access ' https://github.com/symfony/var-dumper.git/ ': Failed connec t to github.com:443; https://github.com/symfony/var-dumper.git克隆到'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'...致命:无法访问' https:// github.com/symfony/var-dumper.git/ ': 无法连接到 github.com:443; No error没有错误

    • git@github.com:symfony/var-dumper.git Cloning into 'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'... Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known h osts. git@github.com:symfony/var-dumper.git Cloning into 'C:\\xampp\\htdocs\\laravel-master\\vendor\\symfony\\var-dumper'... 警告:永久添加 'github.com,192.30.252.131 ' (RSA) 到已知主机列表。 Permission denied (publickey).权限被拒绝(公钥)。 fatal: Could not read from remote repository.致命:无法从远程存储库读取。

    Please make sure you have the correct access rights请确保您拥有正确的访问权限

    and the repository exists.并且存储库存在。

Any kind of help would be appreciated.任何形式的帮助将不胜感激。 Thanks in advance!提前致谢!

and here is my composer.json file :这是我的 composer.json 文件:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled"
    ],
    "post-update-cmd": [
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
}

} }

Sadly, this connection error is common when installing projects via GitHub + Composer.遗憾的是,通过 GitHub + Composer 安装项目时,这种连接错误很常见。 If the problem persists after several retries, I'd recommend you to install Laravel using their installer instead.如果多次重试后问题仍然存在,我建议您使用他们的安装程序安装 Laravel。 See http://laravel.com/docs/5.1#installation请参阅http://laravel.com/docs/5.1#installation

The installer just downloads a single ZIP file instead of trying to download lots of small files from GitHub.安装程序只下载一个 ZIP 文件,而不是尝试从 GitHub 下载大量小文件。 This makes it much faster and reliable.这使得它更快更可靠。 Symfony project uses this very same trick and recommends only to use the Symfony Installer. Symfony 项目使用了同样的技巧,并建议只使用 Symfony 安装程序。

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

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