【发布时间】:2015-08-23 08:47:39
【问题描述】:
最近我了解了 Laravel 4.2。然后我切换到 Laravel 5。我一直使用 composer 添加其他依赖项和东西,我一点问题都没有。
上周四,我使用composer create-project laravel/laravel dir_name --prefer-dist 创建了一个新项目。一切顺利。
但是从星期五开始,我什么都做不了。每次我尝试创建新项目、更新依赖项或做任何事情时,都会等待很长时间(几乎就像冻结一样),然后出现错误。它们通常是关于HTTP request failed 或packagist.org 的问题。
在工作中我没有任何问题。我朋友也不行。它在我的电脑上工作,突然停止。请帮忙。
C:\xampp\htdocs\dir_name>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
The "http://packagist.org/p/symfony/routing$0b411061e305b2d7a108caca01c21b859b6a2be133eff320b93e64d8
c5759e2b.json" file could not be downloaded: failed to open stream: HTTP request failed!
http://packagist.org could not be fully loaded, package information was loaded from the local cache
and may be out of date
[here freezes for good (more than 20 minutes), killed]
我的作曲家是最新的:
C:\xampp\htdocs\dir_name>composer self-update
You are already using composer version 9fb2d4f2d642a0749decb41bc2fe4be2bf8bef7a.
C:\xampp\htdocs\dir_name>
那是composer update -vvv:
C:\xampp\htdocs\dir_name>composer update -vvv
Reading ./composer.json
Loading config file C:/Users/Forien/AppData/Roaming/Composer/config.json
Loading config file C:/Users/Forien/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Failed to initialize global composer: Composer could not find the config file: C:/Users/Forien/AppDa
ta/Roaming/Composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.
org/ "Getting Started" section
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
[freeze for over 15 minutes here, killed]
在家里,我在路由器后面,但我不知道没有代理。我不知道发生了什么变化。从composer.json 开始 - 即使使用来自laravel/laravel 的全新干净.json,更新也无法正常启动。
任何帮助表示赞赏。您对为什么会发生这种情况或如何解决这个问题有任何想法吗?
编辑
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be
downloaded: SSL: Handshake timed out
Failed to enable crypto
failed to open stream: operation failed
Checking github.com oauth access: OK
Checking disk free space: OK
Checking composer version: OK
作曲家.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"filp/whoops": "^1.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"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
}
}
【问题讨论】:
-
试一试,从作曲家文件夹/文件位置运行作曲家更新并告诉我
-
您能否发布您的 composer.json 并向我们展示您安装了哪些 3rd 方依赖项?
-
@Stony 编辑的问题
-
看来是网络问题。您在运行 composer 的机器上打开
https://packagist.org/packages.json时遇到问题吗?另外,您是否有防病毒或防火墙软件,您是否尝试过禁用它们? -
@Forien 您发布了很多无用的信息,但没有任何帮助解决问题的信息。我想知道 15 个人如何对此表示赞同。可能他们还只是孩子。让我们尝试解决问题:您是否尝试过使用浏览器访问
https://packagist.org/packages.json?
标签: php composer-php