2

Mosquitto-php extension: https://github.com/mgdm/Mosquitto-PHP.

I tried to add 2 below commands in the laradock/php-fpm/Dockerfile, but it didn't work.

apt-get install libmosquitto-dev && \
pecl install Mosquitto-alpha

please give me some advices, thanks.

Amos Wu
  • 23
  • 4
  • To be able to help you you may want to specify wich error messages you have seen and give more feedback to your environment. (Server Version, php version and so on...) Also this question also may be migrated to serverfault.com – finder2 Nov 27 '19 at 09:13
  • @finder2 Thanks your suggestion, I will provide more details about the question. – Amos Wu Nov 28 '19 at 07:38

1 Answers1

1

Try add this in dockerfile:

RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev libxml2-dev libcurl4-gnutls-dev \
        libmosquitto-dev # edit


RUN docker-php-ext-install -j$(nproc) mysqli mbstring pdo pdo_mysql soap curl \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    && pecl install xdebug && docker-php-ext-enable xdebug \
    && pecl install Mosquitto-alpha && docker-php-ext-enable Mosquitto-alpha 
Dmitry Leiko
  • 3,970
  • 3
  • 25
  • 42
  • 1
    It works, many thanks. I add this commands in Dockerfile and build the php-fpm again. `RUN apt-get install -y libmosquitto-dev && \ pecl install Mosquitto-beta && \ docker-php-ext-enable mosquitto` – Amos Wu Nov 28 '19 at 07:34