13

问题1:

我尝试在我的服务器(Ubuntu 12.04、nginx、php5-fpm)上安装 laravel 4,但安装挂起:

# composer install --verbose
Loading composer repositories with package information
Installing dependencies (including require-dev)

- 没有错误,没有任何东西,它只是挂起,仅此而已。我尝试使用composer create-project laravel/laravel --prefer-dist ... 进行安装,结果几乎相同:

Installing laravel/laravel (v4.0.9)
- Installing laravel/laravel (v4.0.9)
Loading from cache

Created project in /var/www/laravel/ex2/laravel
Loading composer repositories with package information
Installing dependencies (including require-dev)

我找不到任何想法/解决方案。

谁能告诉我问题是什么,我该如何解决?

问题2:

@antonio-carlos-ribeiro 是对的,我只需要等待。但现在我遇到了另一个问题:

安装需要30多分钟!以及大量资源(CPU 和磁盘使用)……难以置信的资源量。这是 CPU 和磁盘读/写的图表: 磁盘读/写和 CPU 使用率 我想这不是正常行为。有什么想法吗?

谢谢!

4

6 回答 6

13

这是 Composer 很慢。你需要等待它,是的,它可能需要很多时间。

你也可以尝试一一下载包,“手动”安装 Laravel

创建您的目录并输入它:

mkdir /var/www/laravel/ex2/laravel
cd /var/www/laravel/ex2/laravel

一个一个地下载所有包:

composer require filp/whoops 1.0.7
composer require nikic/php-parser dev-master#700847e
composer require jeremeamia/superclosure 1.0.1
composer require doctrine/lexer dev-master#bc0e1f0
composer require doctrine/annotations v1.1.2
composer require doctrine/collections dev-master#bcb5377
composer require doctrine/cache v1.3.0
composer require doctrine/inflector dev-master#8b4b3cc
composer require doctrine/common dev-master#d9dea98
composer require doctrine/dbal 2.4.x-dev#9efdbce
composer require psr/log 1.0.0
composer require monolog/monolog dev-master#a501075
composer require symfony/translation 2.3.x-dev#6aedcff
composer require symfony/routing 2.3.x-dev#7d41463
composer require symfony/process 2.3.x-dev#8289810
composer require symfony/debug 2.3.x-dev#085d4fd
composer require symfony/http-foundation 2.3.x-dev#796619f
composer require symfony/event-dispatcher 2.3.x-dev#2d8ece3
composer require symfony/http-kernel 2.3.x-dev#9795c9f
composer require symfony/finder 2.3.x-dev#a175521
composer require symfony/dom-crawler 2.3.x-dev#4dc2c59
composer require symfony/css-selector 2.3.x-dev#8df20c5
composer require symfony/console 2.3.x-dev#f880062
composer require symfony/browser-kit 2.3.x-dev#7fc66ea
composer require symfony/filesystem dev-master#e558fd5
composer require swiftmailer/swiftmailer v5.0.2
composer require predis/predis 0.8.x-dev#ff004ae
composer require patchwork/utf8 v1.1.14
composer require nesbot/carbon 1.4.0
composer require ircmaxell/password-compat 1.0.x-dev#1fc1521
composer require classpreloader/classpreloader 1.0.1

最后下载 Laravel

composer require laravel/framework 4.0.x-dev
composer require laravel/laravel 4.0.x

把它移到正确的地方

mv -f vendor/laravel/laravel/* .
mv -f vendor/laravel/laravel/.g* .
rm -rf vendor/laravel/laravel

并执行这个来修复你的 composer.lock

composer update

下载软件包后,Composer 会将它们缓存在您的主文件夹中,因此下次安装时您不必手动下载所有软件包,当然,除非有一些已更新。

注意:这仅适用于 Laravel 4.0.9,因为其中一些包被“标记”为下载特定的提交(例如:#700847e)。

于 2013-11-07T01:35:47.420 回答
9

对我来说,作曲家供应商。我只是composer -vvv update

于 2017-11-30T13:29:46.963 回答
4

我将它安装在 xampp 目录中的 Windows 机器上,发现它在 Apache 运行时被挂起,当我停止 Apache 时它立即启动并在几秒内结束。

于 2015-02-04T18:58:48.967 回答
3

确保您没有默认启用 xdebug。如果有,请将其关闭。

我遇到了类似的问题,加载 JSON 依赖项需要一个小时(对于 Laravel)。关闭 cli 的 xdebug 后,一切都会在几秒钟内加载!

于 2014-08-31T10:57:28.410 回答
1

老问题,但我找到了新答案。

我的php-cli 没有php-curl启用扩展。

安装和启用它就可以了。

于 2021-04-22T00:56:44.363 回答
0

一种可能性是您有无法解决的依赖关系:

您的要求无法解决为一组可安装的软件包。

正如其他人所提到的,您可能只需要运行composer install并等待。如果无法解决依赖关系,composer 将扫描所有可能的选项——这可能需要很长时间。

如果您有很多依赖项 - 您可能想尝试从composer.json一开始就删除所有内容,然后一次将它们添加回来以发现哪些无法解决。

最终完成时composer install- 仔细阅读输出,看看是否缺少需要手动安装的依赖项。

就我而言,我只是想安装一个包。这是我的composer.json

{
    "require-dev": {
        "phpunit/phpunit": "^8"
}

composer install跑了好久终于报:

  Problem 1
- phpunit/phpunit 8.5.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.5.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.4.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.3.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.2.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.1.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.6 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.5 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.4 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.3 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.2 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- phpunit/phpunit 8.0.0 requires ext-dom * -> the requested PHP extension dom is missing from your system.
- Installation request for phpunit/phpunit ^8 -> satisfiable by phpunit/phpunit[8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.3.0, 8.3.1, 8.3.2, 8.3.3, 8.3.4, 8.3.5, 8.4.0, 8.4.1, 8.4.2, 8.4.3, 8.5.0, 8.5.1, 8.5.2].

所以我安装了缺少的依赖项——PHP 扩展 dom:

sudo apt install php-dom

下次我运行composer install它成功完成。

于 2020-01-24T13:47:38.253 回答