Php: Setting mutli-lang in php:7.0/apache

Created on 26 Oct 2016  路  2Comments  路  Source: docker-library/php

Hello,

I'm trying to add multi-lang support on php:7.0/apache, but my text are never translate.

This is my Dockerfile, that extends the official image :

FROM php:7-apache

RUN apt-get update

# Set locales
RUN apt-get install locales
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
RUN echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen 
RUN echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen
RUN echo "it_IT.UTF-8 UTF-8" >> /etc/locale.gen

# Setting up server
RUN apt-get install -y zlib1g-dev libicu-dev g++ libpq-dev libssl-dev gettext && \
    docker-php-ext-configure intl && \
    docker-php-ext-install intl
RUN docker-php-ext-install gettext
RUN docker-php-ext-install pdo_pgsql
RUN a2enmod rewrite

RUN pecl install mongodb-1.1.8 \
    && docker-php-ext-enable mongodb
RUN echo extension=mongo.so > /usr/local/etc/php/conf.d/mongo.ini
RUN echo extension=gettext.so > /usr/local/etc/php/conf.d/gettext.ini

COPY ./webapp /var/www/html/

Have I missed something ?

Have a good coding day 馃惢

PS : This method (approximatively) works when I previously using PHP 5 from Debian Repo (same without Docker)

Most helpful comment

It looks like you might be missing a RUN locale-gen just after the echo lines. :smile_cat:

All 2 comments

It looks like you might be missing a RUN locale-gen just after the echo lines. :smile_cat:

So simply ... thank you @yosifkit :)

Have a good day !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skyzyx picture skyzyx  路  3Comments

solocommand picture solocommand  路  3Comments

ktrzos picture ktrzos  路  3Comments

cordoval picture cordoval  路  3Comments

pavlakis picture pavlakis  路  3Comments