Problem:
I have a Docker compose with an nginx service and a PHP service. When I try to open a page of my dev project, I encounter this error:
Fatal error: Call to undefined function bindtextdomain() in /usr/share/nginx/html/some_project/some_path/Bootstrap.php on line 16
I saw that is a problem of a missing dependency: php-gettext
.
My configuration:
In my Dockerfile, I try to install it:
FROM php:5.6.30-fpm
MAINTAINER DarckCrystale "xxx@xxx.xx"
# Here I try to install the php-gettext extension
# but it does not work
RUN apt-get update && apt-get install -y php-gettext gettext
# Setup PHP configuration
ADD php.ini /usr/local/etc/php/conf.d/php.ini
In my php.ini, I load it:
extension=gettext.so
Other information:
When I run in my container
php -i | grep extension_dir
I have this message displayed:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/gettext.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/gettext.so: cannot open shared object file: No such file or directory in Unknown on line 0
What it seems to be to me:
I think
RUN apt-get update && apt-get install -y php-gettext gettext
does not install the php-gettext
extension. I don't know why. I think this is a PHP Dockerized specific problem.