Docker-php-ext-install mcrypt缺少文件夹 [英] Docker-php-ext-install mcrypt missing folder

查看:1031
本文介绍了Docker-php-ext-install mcrypt缺少文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试基于php:7.2-apache在我的docker映像中安装mcrypt.因此,我使用文档中的RUN-Command并在此处回答,但是我收到此错误:

I try to install mcrypt in my docker image based on php:7.2-apache. Therefore I use the RUN-Command from the documentation and also answerd here but I receive this error:

error: /usr/src/php/ext/mcrypt does not exist


usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]

   ie: /usr/local/bin/docker-php-ext-install gd mysqli
   /usr/local/bin/docker-php-ext-install pdo pdo_mysql
   /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop

if custom ./configure arguments are necessary, see docker-php-ext-configure

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp  gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8  odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip

Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y          libfreetype6-dev          libjpeg62-turbo-dev          libmcrypt-dev          libpng-dev     && docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip' returned a non-zero code: 1

我的Dockerfile:

My Dockerfile:

FROM php:7.2-apache

RUN apt-get update && apt-get install -y \
     libfreetype6-dev \
     libjpeg62-turbo-dev \
     libmcrypt-dev \
     libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip
#    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
#    && docker-php-ext-install -j$(nproc) gd


COPY ./etc/000-default.conf /etc/apache2/sites-available/

EXPOSE 80

有人知道如何解决或如何在请求的文件夹中获取所需的文件吗?

Has anybody an idea how to solve or how to get the needed files in the requested folder?

谢谢!

推荐答案

mycrypt 扩展未随PHP源提供,因为 docker 中安装 PECL 扩展,请使用pecl install下载并编译它,然后使用docker-php-ext-enable启用它:

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.3
docker-php-ext-enable mcrypt

这篇关于Docker-php-ext-install mcrypt缺少文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆