如何在 CentOS 6 驱动的 Nginx VPS 中安装 php ssh2

如何在 CentOS 6 驱动的 Nginx VPS 中安装 php ssh2

我正在尝试在我的 CentOS 6 驱动的 VPS 上安装 php-ssh2。我使用 Nginx 作为 Web 服务器。我想告诉你们,我已经使用 REMI 的存储库安装了 php-fpm。我不是 VPS 专家。在设置我的新 VPS 时,我安装了两个存储库。一个是 REMI 的,另一个是 EPEL 的存储库。

第一次配置我的 VPS 时,我使用以下方式安装了上述两个存储库

sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

我一直在尝试使用以下命令安装 php-ssh2。

sudo yum install php-pecl-ssh2

每当我从命令行运行此命令时,它都会显示一个错误,并且这个错误在安装其他一些软件包时也发生了!我不知道发生了什么。

我收到的错误如下所示:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

 * base: mirror.san.fastserv.com
 * epel: mirrors.kernel.org
 * extras: mirror.pac-12.org
 * updates: mirrors.easynews.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-ssh2.x86_64 0:0.11.0-7.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Processing Dependency: /usr/bin/pecl for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Running transaction check
---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
--> Processing Dependency: php-cli >= 5.1.0-1 for package: 1:php-pear-1.9.4-4.el6.noarch
---> Package php-pecl-ssh2.x86_64 0:0.11.0-7.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-23.el6_4 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-23.el6_4 for package: php-cli-5.3.3-23.el6_4.x86_64
---> Package php-pecl-ssh2.x86_64 0:0.11.0-7.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-pecl-ssh2-0.11.0-7.el6.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-ssh2-0.11.0-7.el6.x86_64 (epel)
           Requires: php(api) = 20090626
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php(api) = 20100412-x86-64
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php(api) = 20090626
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php(api) = 20090626
Error: Package: php-pecl-ssh2-0.11.0-7.el6.x86_64 (epel)
           Requires: php(zend-abi) = 20090626
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php(zend-abi) = 20100525-x86-64
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php(zend-abi) = 20090626
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php(zend-abi) = 20090626
Error: Package: php-cli-5.3.3-23.el6_4.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-23.el6_4
           Installed: php-common-5.4.17-2.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.17-2.el6.remi
           Available: php-common-5.3.3-22.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-22.el6
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php-common(x86-64) = 5.3.3-23.el6_4
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

请简要告诉我该怎么做才能永久修复此问题,并告诉我发生这种情况的原因?请告诉我如何使用 RPM 存储库安装 php-ssh2 包。

答案1

您已从 remi 存储库安装了 php,但您正在尝试安装 epel php-pecl-ssh2 包。
您应该启用 remi 存储库,例如

yum --enablerepo=remi install php-pecl-ssh2

或者在 /etc/yum.repos.d/* 全局(不确定确切的文件名)。

相关内容