Merge pull request #2919 from PavelSavushkinMix/fix/swoole_extension

fix(SWOOLE extension): add SWOOLE extension installed correctly
This commit is contained in:
Shao Yu-Lung (Allen) 2021-03-23 12:26:18 +08:00 committed by GitHub
commit 10066f887b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -337,16 +337,17 @@ ARG INSTALL_SWOOLE=false
RUN if [ ${INSTALL_SWOOLE} = true ]; then \ RUN if [ ${INSTALL_SWOOLE} = true ]; then \
# Install Php Swoole Extension # Install Php Swoole Extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \
pecl -q install swoole-2.0.10; \ echo '' | pecl -q install swoole-2.0.10; \
elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
echo '' | pecl -q install swoole-4.3.5; \
elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \
echo '' | pecl -q install swoole-4.5.11; \
else \ else \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \ echo '' | pecl -q install swoole; \
pecl install swoole-2.2.0; \ fi; \
else \ docker-php-ext-enable swoole \
pecl install swoole; \ && php -m | grep -q 'swoole' \
fi \
fi \
&& docker-php-ext-enable swoole \
;fi ;fi
########################################################################### ###########################################################################

View File

@ -551,13 +551,13 @@ RUN set -eux; \
if [ ${INSTALL_SWOOLE} = true ]; then \ if [ ${INSTALL_SWOOLE} = true ]; then \
# Install Php Swoole Extension # Install Php Swoole Extension
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \ if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \
pecl install swoole-2.0.10; \ echo '' | pecl -q install swoole-2.0.10; \
elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
pecl install swoole-4.3.5; \ echo '' | pecl -q install swoole-4.3.5; \
elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \ elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \
pecl install swoole-4.5.11; \ echo '' | pecl -q install swoole-4.5.11; \
else \ else \
pecl install swoole; \ echo '' | pecl -q install swoole; \
fi; \ fi; \
echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini; \ echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini; \
ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini; \ ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini; \