davidalger / docker-images-php

PHP and PHP-FPM images for Docker based on EL 8
https://hub.docker.com/r/davidalger/php
MIT License
15 stars 16 forks source link

Please need hlep installing ext-ssh2 #1

Closed mojotaker closed 4 years ago

mojotaker commented 4 years ago

Hello, first of all, thank you for making your work available to us. Im not very knowledgeable here.

Im trying to install ext-ssh2 extension. Ultimately, i would like to create my own image with the extension installed.

Currently in my container i noticed pecl is not installed. So I decided to install php-pear. when i install it like so sudo yum install php-pear it installs php-pear noarch 1:1.9.4-21.el7 once installed, when i run pecl this error shows up. PHP Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/pear/PEAR/Frontend.php on line 91 I cant get past this error.

Please how can I install this extension ? And if i wanted to create an image/dockerfile from yours, how can I have ext-ssh2 installed ?

Thank you.

mojotaker commented 4 years ago

I was able to solve this issue. The version of php-pear installed, needs to be uninstalled and replaced with pear1u

davidalger commented 4 years ago

@mojotaker If you're needing this package ongoing, it might good to hop on over here to the IUS wishlist and request it for specific PHP versions so you'll then be able to add something like the following in your custom Dockerfile when extending these images:

RUN set -eux \
    && PHP_VERSION=$(php -v | head -n1 | cut -d' ' -f2 | awk -F '.' '{print $1$2}') \
    && if (( ${PHP_VERSION} >= 73 )); \
        then yum install -y php${PHP_VERSION}-pecl-ssh2; \
        else yum install -y php${PHP_VERSION}u-pecl-ssh2; \
    fi \
    && yum clean all \
    && rm -rf /var/cache/yum