Linux – How tonstall php ssh2 in CentOS 6 powered Nginx VPS

centoscentos6linuxnginxvps

I'm trying to install php-ssh2 on my CentOS 6 powered VPS. I'm using Nginx as web server. I want to tell you guys that I've installed php-fpm using REMI's repo. I'm not a VPS expert. While setting up my new VPS, I had installed two repos. One is REMI's and other one is EPEL's repository.

Configuring my VPS first time I had installed the above two repositories using

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

I've been trying to install php-ssh2 using the below command.

sudo yum install php-pecl-ssh2

Whenever I run this command from the command line, It shows an error and this error had occured while installing some other packages too! I don't know what's going on.

The error I'm getting is written below:

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

Please tell me in brief what to do so that this problem gets fixed permanently and also tell me the reason why this is happening? Please tell me how to install php-ssh2 package using RPM repository.

Best Answer

You have php installed from the remi repository but you are trying to install a epel php-pecl-ssh2 package.
You should enable the remi repo, e.g.

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

Or globally in /etc/yum.repos.d/* (not sure about the exact file name).