php:7.4.0beta4-apache configure error on mbstring ext install

Created on 27 Aug 2019  路  3Comments  路  Source: docker-library/php

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"]

Most helpful comment

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"]

All 3 comments

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

https://packages.debian.org/buster/libonig-dev

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nojimage picture nojimage  路  3Comments

igodorogea picture igodorogea  路  3Comments

PMExtra picture PMExtra  路  3Comments

mcnesium picture mcnesium  路  3Comments

2Kable picture 2Kable  路  3Comments