Skip to content

Commit

Permalink
fix php-fpm AMQP build for 5.6, 7.0 and 7.1 (#1965)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanphan authored and bestlong committed Feb 9, 2019
1 parent 913abc5 commit b1e3463
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions php-fpm/Dockerfile
Expand Up @@ -221,7 +221,16 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ARG INSTALL_AMQP=false

RUN if [ ${INSTALL_AMQP} = true ]; then \
apt-get install librabbitmq-dev -y && \
# download and install manually, to make sure it's compatible with ampq installed by pecl later
# install cmake first
apt-get update && apt-get -y install cmake && \
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz && \
mkdir -p rabbitmq-c && \
tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \
cd rabbitmq-c/ && \
mkdir _build && cd _build/ && \
cmake .. && \
cmake --build . --target install && \
# Install the amqp extension
pecl install amqp && \
docker-php-ext-enable amqp && \
Expand Down Expand Up @@ -550,7 +559,11 @@ RUN if [ $INSTALL_PHALCON = true ]; then \
ARG INSTALL_APCU=false

RUN if [ ${INSTALL_APCU} = true ]; then \
pecl install apcu && \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install -a apcu-4.0.11; \
else \
pecl install apcu; \
fi && \
docker-php-ext-enable apcu \
;fi

Expand All @@ -564,7 +577,11 @@ ARG INSTALL_YAML=false

RUN if [ ${INSTALL_YAML} = true ]; then \
apt-get install libyaml-dev -y ; \
pecl install yaml ; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install -a yaml-1.3.2; \
else \
pecl install yaml; \
fi && \
docker-php-ext-enable yaml \
;fi

Expand Down

0 comments on commit b1e3463

Please sign in to comment.