gpt4 book ai didi

php - Docker-php-ext-install mcrypt 缺少文件夹

转载 作者:IT老高 更新时间:2023-10-28 12:37:30 27 4
gpt4 key购买 nike

我尝试根据 php:7.2-apache 在我的 docker 镜像中安装 mcrypt。因此,我使用文档中的 RUN-Command 并回答了 here但我收到此错误:

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:

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

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

谢谢!

最佳答案

mcrypt 扩展不随 PHP 源提供,因为 7.2 ,但可用 through PECL .在 docker 中安装 PECL 扩展,使用pecl install下载编译,然后使用docker-php-ext-enable开启:

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

pecl install 之前,您可能需要安装/更新包 libmcrypt-dev

apt-get update && apt-get install -y libmcrypt-dev

关于php - Docker-php-ext-install mcrypt 缺少文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47671108/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com