fix php-fpm AMQP build for 5.6, 7.0 and 7.1 (#1965)

This commit is contained in:
Lan Phan 2019-02-09 15:33:06 +07:00 committed by Shao Yu-Lung (Allen)
parent 913abc54f9
commit b1e346383b

View File

@ -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 && \
@ -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
@ -564,7 +577,11 @@ ARG INSTALL_YAML=false
RUN if [ ${INSTALL_YAML} = true ]; then \
apt-get install libyaml-dev -y ; \
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