gpt4 book ai didi

php - Docker 和 Laravel : configure: error: Package requirements (oniguruma) were not met

转载 作者:行者123 更新时间:2023-12-01 16:23:49 29 4
gpt4 key购买 nike

谁能帮我解决这个问题。

当我尝试从 Laravel 应用程序的 dockerfile 创建 docker 镜像时,出现此错误:

checking for oniguruma... no configure: error: Package requirements (oniguruma) were not met:

No package 'oniguruma' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ONIG_CFLAGS
and ONIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

The command '/bin/sh -c docker-php-ext-install pdo mbstring' returned a non-zero code: 1

这是我的 Dockerfile:

FROM php:7
RUN apt-get update -y && apt-get install -y openssl zip unzip git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-install pdo mbstring
WORKDIR /app
COPY app /app # this copies all the app files to a folder called `app`
RUN composer install

CMD php artisan serve --host=0.0.0.0 --port=8000
EXPOSE 8000

以及构建 Dockerfile 的 docker 命令

sudo docker build -t test .

最佳答案

@kalatabe 说的是正确的。但如果您绝对想确保安装 mbstring,您还可以将 libonig-dev 添加到您的 apt-get install

关于php - Docker 和 Laravel : configure: error: Package requirements (oniguruma) were not met,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59251008/

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