Docker Community Forums

Share and learn in the Docker community.

Php.ini file makes it to my container, but has no impact on phpinfo();


(Bryden) #1

I’m trying to change some settings in my php.ini file but even though the file is being copied over, for some reason the settings don’t change when I check phpinfo();

I’m doing it like this in a Dockerfile:

FROM php:5.6-fpm

RUN apt-get update
RUN apt-get install -y zlib1g-dev libjpeg-dev libpng-dev libfreetype6-dev

RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install gd
RUN docker-php-ext-install mysqli

COPY ./php.ini /usr/local/etc/php/

And I’ve also tried mounting that file through my docker-compose.yml file like this:

php:
    build: ./php/
    expose:
        - 9000
    links:
        - mysql
    volumes:
        - ./php/php.ini:/usr/local/etc/php/php.ini
    volumes_from:
        - app

When I take a look at that file in the container, the file is making it over to the container. And when I run phpinfo(); I can see that this file is being loaded:

Loaded Configuration File	/usr/local/etc/php/php.ini

If I remove this file, phpinfo(); says:

Loaded Configuration File	(none)

But for some reason, none of the settings in my php.ini file have any impact. I can’t change maximum_upload, or anything else.

Anybody have any ideas?

Thank you!

Bryden


(Phinz) #2

I have a similar Problem. I can’t change the content of single mounted files.

https://forums.docker.com/t/docker-compose-single-volume-file-fails-to-sync-after-modifying-on-host/16121