Docker-php-ext-install mcrypt missing folder

懵懂的女人 提交于 2019-12-03 01:13:57

mycrypt extension is not provided with the PHP source since 7.2 , but are instead available through PECL. To install a PECL extension in docker, use pecl install to download and compile it, then use docker-php-ext-enable to enable it:

pecl install mcrypt-1.0.2
docker-php-ext-enable mcrypt

To install mcrypt extension you have to make sure you did install libmcrypt-dev which is required.

Try to add:

RUN apt install libmcrypt-dev

before you are trying to install extensions for php.

Update

Try to run first:

docker-php-ext-configure mcrypt

and then

docker-php-ext-install mcrypt

Building on MoiioM's answer, this worked for me using the 7.2-stretch Docker image from PHP

RUN apt-get update && apt-get install -y libmcrypt-dev \
    && pecl install mcrypt-1.0.2 \
    && docker-php-ext-enable mcrypt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!