Skip to content

Commit b1e3463

Browse files
lanphanbestlong
authored andcommitted
fix php-fpm AMQP build for 5.6, 7.0 and 7.1 (laradock#1965)
1 parent 913abc5 commit b1e3463

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

php-fpm/Dockerfile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,16 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
221221
ARG INSTALL_AMQP=false
222222

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

552561
RUN if [ ${INSTALL_APCU} = true ]; then \
553-
pecl install apcu && \
562+
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
563+
pecl install -a apcu-4.0.11; \
564+
else \
565+
pecl install apcu; \
566+
fi && \
554567
docker-php-ext-enable apcu \
555568
;fi
556569

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

565578
RUN if [ ${INSTALL_YAML} = true ]; then \
566579
apt-get install libyaml-dev -y ; \
567-
pecl install yaml ; \
580+
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
581+
pecl install -a yaml-1.3.2; \
582+
else \
583+
pecl install yaml; \
584+
fi && \
568585
docker-php-ext-enable yaml \
569586
;fi
570587

0 commit comments

Comments
 (0)