diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 62d02c1..3fa164a 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -135,8 +135,12 @@ ARG INSTALL_SWOOLE=false RUN if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension - pecl install swoole \ - && docker-php-ext-enable swoole \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install swoole-2.0.11; \ + else \ + pecl install swoole; \ + fi && \ + docker-php-ext-enable swoole \ ;fi ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index fdc3c2e..d468965 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -305,7 +305,11 @@ ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension - pecl -q install swoole && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl -q install swoole-2.0.11; \ + else \ + pecl -q install swoole; \ + fi && \ echo "extension=swoole.so" >> /etc/php/${PHP_VERSION}/mods-available/swoole.ini && \ ln -s /etc/php/${PHP_VERSION}/mods-available/swoole.ini /etc/php/${PHP_VERSION}/cli/conf.d/20-swoole.ini \ ;fi