The oniguruma package fails with the following error when trying to install mbstring:
docker-php-ext-install mbstring
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.
For reference, this is my updated Dockerfile
FROM php:7.4.0beta4-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
zlib1g-dev \
libxml2-dev \
libzip-dev \
graphviz \
&& docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install zip \
# && docker-php-ext-install mbstring \
&& docker-php-source delete
RUN a2enmod rewrite
RUN service apache2 restart
# Ports
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]
Following advice from Derick Rethans
The package libonig-dev should be added instead. Which fixes the above error and includes mbstring
For reference, the fixed Dockerfile:
FROM php:7.4.0beta4-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
zlib1g-dev \
libxml2-dev \
libzip-dev \
libonig-dev \
graphviz \
&& docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install zip \
&& docker-php-source delete
RUN a2enmod rewrite
RUN service apache2 restart
# Ports
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]
I you search, for Alpine EDGE, the Package is oniguruma-dev (https://pkgs.alpinelinux.org/packages?name=oniguruma-dev&branch=edge).
For readers using debian based images, the package you want is libonig-dev
Most helpful comment
Following advice from Derick Rethans
The package
libonig-devshould be added instead. Which fixes the above error and includesmbstringFor reference, the fixed
Dockerfile: