Install timezonedb in docker image
P粉158473780
P粉158473780 2023-08-31 10:45:54
0
1
425
<p>How to set <code>extension=timezonedb.so</code> in docker PHP image? Installed timezonedb in docker bash manual and added <code>extension=timezonedb.so</code> to php.ini but didn't work for me. </p> <p>Install timezonedb in docker bash manual and add <code>extension=timezonedb.so</code> to php.ini but it doesn't work for me. </p>
P粉158473780
P粉158473780

reply all(1)
P粉696146205

https://serverfault.com/questions/1123233/why-timezonedb-extension-have-the-latest-data

method one.

RUN docker-php-source extract \
    && pecl bundle -d /usr/src/php/ext timezonedb \
    && docker-php-ext-configure timezonedb \
    && docker-php-ext-install -j$(nproc) timezonedb \
    && docker-php-source delete

Method 2.

RUN mkdir -p /usr/local/src/pecl \
    && pecl bundle -d /usr/local/src/pecl timezonedb \
    && docker-php-ext-configure /usr/local/src/pecl/timezonedb \
    && docker-php-ext-install -j$(nproc) /usr/local/src/pecl/timezonedb \
    && rm -rf /usr/local/src/pecl

Method 3.

RUN apt-get -y install gcc make autoconf libc-dev pkg-config \
    && pecl install timezonedb \
    && bash -c "echo extension=timezonedb.so > /usr/local/etc/php/conf.d/docker-php-ext-timezonedb.ini"

These 3 methods all work fine. After building the docker container, I confirmed that the extension was installed and loaded correctly by checking the PHP information.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template