How to install extension for php via docker-php-ext-install?

后端 未结 5 812
再見小時候
再見小時候 2020-12-28 13:40

In order to resolve an issue, I am now trying install the mysql pdo via

docker-php-ext-install

as pointed out in the README of the php imag

5条回答
  •  醉梦人生
    2020-12-28 13:49

    You can achieve this with only 3 short lines of code. Here is an example for PHP7.4-FPM (Check the attached github link for guidance on other image variants and versions)

    Dockerfile:

    FROM php:7.4-fpm
    
    COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
    
    RUN install-php-extensions mysqli pdo_mysql
    

    As of the posting of this response the plugin supports up to 80 PHP Extensions which I find it supper amazing. You can get more info on this github repository

提交回复
热议问题