Linux

如何在 CentOS 6 驅動的 Nginx VPS 中安裝 php ssh2

  • August 19, 2013

我正在嘗試在我的 CentOS 6 驅動的 VPS 上安裝 php-ssh2。我使用 Nginx 作為網路伺服器。我想告訴你們,我已經使用 REMI 的 repo 安裝了 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 包。

您已經從 remi 儲存庫安裝了 php,但您正在嘗試安裝 epel php-pecl-ssh2 軟體包。

您應該啟用 remi repo,例如

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

或全域在 /etc/yum.repos.d/* 中(不確定確切的文件名)。

引用自:https://serverfault.com/questions/531924