From 983fb1479568bb11e867cd814d653a88d7ac3f16 Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 4 Apr 2021 21:29:54 +0800 Subject: [PATCH] fix php-fpm AMQP extension install failed #2929 --- php-fpm/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 46420241..d7e98ba6 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -401,7 +401,11 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \ # download and install manually, to make sure it's compatible with ampq installed by pecl later # install cmake first apt-get -yqq install cmake && \ - curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ] || [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \ + curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/v0.11.0.tar.gz; \ + else \ + curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz; \ + fi && \ mkdir -p rabbitmq-c && \ tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \ cd rabbitmq-c/ && \ @@ -416,7 +420,8 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \ fi && \ docker-php-ext-enable amqp && \ # Install the sockets extension - docker-php-ext-install sockets \ + docker-php-ext-install sockets && \ + php -m | grep -q 'sockets' \ ;fi ###########################################################################