如何安装php-fpm-5.5 rpm,同时安装所有依赖项


How to install php-fpm-5.5 rpm with all dependencies installed at once

我在VPS上运行centos6。当我编写命令时,

# rpm -ivh ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-fpm-5.5.4-1.el6.remi.i686.rpmrpm -ivh ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-fpm-5.5.4-1.el6.remi.i686.rpm

输出为

# rpm -ivh ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-fpm-5.5.4-1.el6.remi.i686.rpm
Retrieving ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-fpm-5.5.4-1.el6.remi.i686.rpm
error: Failed dependencies:
        php-common(x86-32) = 5.5.4-1.el6.remi is needed by php-fpm-5.5.4-1.el6.remi.i686

所以我去安装 php-common

# rpm -Uvh ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-common-5.5.4-1.el6.remi.i686.rpm

它带有这些依赖项

Retrieving ftp://195.220.108.108/linux/remi/enterprise/6/test/i386/php-common-5.5.4-1.el6.remi.i686.rpm
error: Failed dependencies:
        php-pecl-jsonc(x86-32) is needed by php-common-5.5.4-1.el6.remi.i686
        php-pecl-zip(x86-32) is needed by php-common-5.5.4-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-cli-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-pdo-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-gd-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-fpm-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-xml-5.4.20-1.el6.remi.i686
        php-common(x86-32) = 5.4.20-1.el6.remi is needed by (installed) php-mbstring-5.4.20-1.el6.remi.i686

我的问题 - 有没有办法一次安装它们?对不起,如果我这么菜鸟!

使用 yum

根据我在该目录中看到的文件,我猜测它是"Remi"构建的镜像。我在 http://rpms.famillecollet.com/找到了他们。对于 CentOS 6,只需安装他们的存储库 RPM,然后yum install php-fpm

rpm 是命令行工具,是非常基本的,无法满足依赖关系。 您无法有效地使用它来隐式安装任何内容。

rpm 将报告缺少的依赖项并干净地退出,像 yum 或 apt(for rpm) 这样的工具将尝试满足这些依赖项并将其提供程序隐式添加到安装目标。

简而言之,您没有使用最好的工具来完成您正在做的工作。 如果你需要它只是(大部分)做正确的事情,请使用 yum 或 apt。