phpmosquittolaradocklibmosquitto

How can I install the Mosquitto-php in Laradock


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.


Solution

  • 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