Rad*_*duS 2 laravel composer-php laravel-4
我正在尝试安装Laravel 4,但我一直在设置这个错误.如果您对如何解决它有任何提示,我将非常感谢您的帮助.
这是希望我到目前为止尝试过
启用php扩展:php_openssl,php_curl,php_socket
在Apache模块中,启用了ssl_module
在所有php.ini文件中我使用了openssl
禁用防火墙
我的配置:
Composer已安装
$ composer create-project laravel/laravel project-v1 --prefer-dist
[Composer\Downloader\TransportException]
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]
Run Code Online (Sandbox Code Playgroud)小智 8
首先,如果您正在运行Web过滤器,尤其是K9 Web Protection,请先卸载它,然后重试.如果问题仍然存在,请提前阅读:
问题是,在向服务器发出第一个https请求后,Composer会降级为http请求.这样做是为了提高性能/速度,并通过sha256哈希确保文件完整性/安全性.在任何情况下,这将导致10053错误(errno = 10053已建立的连接被主机上的软件中止...无法打开流:HTTP请求失败!)在某些计算机上.
这种情况发生在一些人而不是其他人的原因似乎是您的ISP处理http请求的方式.就我而言,它们通过缓存代理重新路由; 这与Composer制作其http请求的方式不兼容.这就是发生在我身上的事 - 其他人可能有不同的原因.无论如何,修复方法是强制Composer使用https请求而不是http请求:
将以下内容添加到Composer安装的配置文件(composer.json)中.在Windows中,您可以在C:\ Users {Your Username}\AppData\Roaming\Composer中找到此文件.
"repositories": [
{
"packagist": false
},
{
"type": "composer",
"url": "https://packagist.org/"
}
],
Run Code Online (Sandbox Code Playgroud)
然后继续按照您的尝试再次创建项目.它现在应该工作.
| 归档时间: |
|
| 查看次数: |
1397 次 |
| 最近记录: |