2 php versions on server (5.6 & 7). Trying to add pecl ssh2 ext to php version 5.6

Discussion in 'Installation/Configuration' started by sza, Aug 27, 2017.

  1. sza

    sza Member

    Can someone help please?
    The command:
    pecl install ssh2-0.13
    Outputs:
    pecl/ssh2 requires PHP (version >= 4.0.0, version <= 6.0.0), installed version is 7.0.22-0ubuntu0.16.04.1

    How can I install it to my php 5.6 ?
    ( php.ini file location is /opt/php-5.6.30/lib/php.ini )
     
  2. sza

    sza Member

    Some more information.
    When I installed the second php version I've used this howto:
    https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/
    I've tried to install it the same way xDebug is being installed in that guide.
    cd /opt/php-5.6.30/etc
    pecl -C ./pear.conf update-channels
    pecl -C ./pear.conf install ssh2

    But I get the same error message:
    pecl/ssh2 requires PHP (version >= 4.0.0, version <= 6.0.0), installed version is 7.0.22-0ubuntu0.16.04.1

    I will appreciate any help you can provide.

    Thank you very much,
     
  3. sza

    sza Member

    Also tried to change shell php alias to
    alias php=/opt/php-5.6.30/bin/php
    (didn't work :( )
     
  4. sza

    sza Member

    Please help... I'm desperate.
     
  5. sza

    sza Member

    Thank you for your answer,
    As for PHP7 - you are correct, the apt package is the best solution.
    As I wrote, I'm looking for a solution for the pecl ssh2 installation for php 5.6.
    The main problem is PECL only detects the php7 installation even though I've entered the -C tag which supposed to load a custom configuration for the php 5.6 installation.

    Have a nice day.
     
  6. sza

    sza Member

    Done by changing the pecl script to always work through php5.6 version
    ( I've edited nano /usr/bin/pecl
    and added this line after the first code block (after it checks the php version )

    PHP="/opt/php-5.6.30/bin/php"

    )
     
  7. sza

    sza Member

    1. The client has a system that does not support php7 and needs ssh2 extension installed over php5.6 .
    2. I've already noticed that you keep answering useless answers. Not only to me.
    Thanks for trying helping me, but if you do not know the answer or a lead to the answer - please don't write useless words.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you try to use the pecl of the compiled version instead, e.g.:

    /opt/php-5.6.30/bin/pecl -C ./pear.conf update-channels
     
    Jesse Norell likes this.
  9. sza

    sza Member

    Hi Till,
    Thank you. I guess this was the correct answer from the first place.
    Thank you very much.
     

Share This Page