我尝试在我的服务器上安装laravel 4(Ubuntu 12.04,nginx,php5-fpm),但安装挂起:
# 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)
我找不到任何想法/解决方案。
有人可以告诉我这是什么问题,我该如何解决?
安装需要30多分钟!而且很多资源(CPU和磁盘使用)......令人难以置信的资源量。 以下是CPU和DISK读/写的图表: 我想这不是正常行为。有什么想法发生了什么?
谢谢!
答案 0 :(得分:8)
这是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)。
答案 1 :(得分:3)
我在xampp目录下的Windows机器上安装它,发现它在Apache运行时被挂起,当我停止Apache时它会立即启动并以秒为单位结束。
答案 2 :(得分:1)
确保默认情况下没有启用xdebug。如果有,请将其关闭。
我有类似的问题,加载JSON依赖关系需要一个小时(对于Laravel)。关闭xdebug for cli之后几秒内就会加载所有东西!
答案 3 :(得分:0)
对我来说是作曲家的供应商。我做了composer -vvv update
答案 4 :(得分:0)
一种可能性是您具有无法解决的依赖项:
您的要求无法解决为一组可安装的 包。
正如其他人所提到的,您可能只需要运行composer install
并等待。如果无法解决依赖关系,则作曲者将扫描所有可能的选项-这可能需要很长时间。
如果您有很多依赖项,则可能要先尝试从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
时,它成功完成了。
答案 5 :(得分:0)
老问题,但我找到了新答案。
我的 php-cli
没有启用 php-curl
扩展。
安装并启用它就行了。