From 9250326664f002ed155819cd8a765916ed5b23a7 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 27 May 2018 19:47:13 +0800 Subject: [PATCH] Swoole support php5 (#1571) * php5 fpm support swoole * php5 workspace support swoole --- php-fpm/Dockerfile | 8 ++++++-- workspace/Dockerfile | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 62d02c10..3fa164ab 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 fdc3c2ef..d468965a 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