Laravel 4:Windows 8 XAMPP/WAMP 上的安装错误 [英] Laravel 4: Installation error on Windows 8 XAMPP/WAMP

查看:23
本文介绍了Laravel 4:Windows 8 XAMPP/WAMP 上的安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装 Laravel 4,但我不断收到此错误.如果您对如何解决它有任何提示,我将不胜感激.

I am trying to install Laravel 4 but I keep geting this error. If you have any hints on how to solve it, I would appreciate your help.

这是我到目前为止尝试过的想要的东西

Here is want i tried so far

  • 启用 php 扩展:php_openssl、php_curl、php_socket

在 Apache 模块中,启用 ssl_module

In Apache Modules, enabled ssl_module

在我启用的所有 php.ini 文件中 openssl

in the all php.ini files i enebaled openssl

禁用防火墙

我的配置:

  • Windows 8
  • 使用 Git Bash
  • 在 XAMPP/WAMPP 上都试过了,我得到了同样的错误
  • Composer 已安装

  • Windows 8
  • Using Git Bash
  • Tried on both XAMPP/WAMPP and i get the same error
  • Composer is installed

$ composer create-project laravel/laravel project-v1 --prefer-dist

  [ComposerDownloaderTransportException]
  The "http://packagist.org/p/laravel/laravel$cfb9a31046c5c103d3b5e46a51b5a18
  a629de734f094f489e2b7df1420078c17.json" file could not be downloaded: send
  of 103 bytes failed with errno=10053 An established connection was aborted
  by the software in your host machine.

  send of 21 bytes failed with errno=10053 An established connection was abor
  ted by the software in your host machine.

  send of 113 bytes failed with errno=10053 An established connection was abo
  rted by the software in your host machine.

  send of 2 bytes failed with errno=10053 An established connection was abort
  ed by the software in your host machine.

  send of 2 bytes failed with errno=10053 An established connection was abort
  ed by the software in your host machine.

  failed to open stream: HTTP request failed!



create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repos
itory-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--n
o-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [ve
rsion]

推荐答案

首先,如果您正在运行 Web 过滤器,尤其是 K9 Web Protection,请先卸载该过滤器并重试.如果问题仍然存在,请继续阅读:

First off, if you're running a web filter, especially K9 Web Protection, uninstall that first and retry. If the problem persists, read ahead:

问题是 Composer 在向服务器发出第一个 https 请求后降级为 http 请求.这样做是为了提高性能/速度并通过 sha256 哈希确保文件完整性/安全性.在任何情况下,这都会在某些机器上导致 10053 错误(errno=10053 已建立的连接已被主机上的软件中止...无法打开流:HTTP 请求失败!).

The problem is that Composer downgrades to http requests after the first https request to the server. This is done to improve performance/speed and to ensure file integrity/security via the sha256 hashes. In any case, this will cause a 10053 error (errno=10053 An established connection was aborted by the software on your host machine ... failed to open stream: HTTP request failed!) on some machines.

这种情况发生在某些人身上而不是其他人身上的原因似乎是您的 ISP 处理 http 请求的方式.就我而言,它们是通过缓存代理重新路由的;这不适用于 Composer 制作其 http 请求的方式.这就是发生在我身上的事情——其他人可能有不同的原因.无论如何,解决方法是强制 Composer 使用 https 请求而不是 http 请求:

The reason this happens to some people and not others seems to be the manner in which your ISP handles http requests. In my case, they're re-routed through a caching proxy; which doesn't work well with the way Composer crafts its http requests. That's what happened to me - others may have a different cause. In any case, the fix is to force Composer to use https requests instead of http requests:

将以下内容添加到您的 Composer 安装配置文件 (composer.json).在 Windows 中,您可以在 C:Users{Your Username}AppDataRoamingComposer 找到此文件.

Add the following to your Composer installation's config file (composer.json). In Windows, you may find this file at C:Users{Your Username}AppDataRoamingComposer.

"repositories": [
{
    "packagist": false
},
{
    "type": "composer",
    "url": "https://packagist.org/"
}
],

然后按照您的尝试重新创建您的项目.它现在应该可以工作了.

Then go ahead and create your project again as you had attempted. It should work now.

这篇关于Laravel 4:Windows 8 XAMPP/WAMP 上的安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆