0

I'm trying to edit the php.ini inside Docker, so I need to do docker-compose up. But every time I do docker-compose up, php.ini returns as it was before.

Oladipo
  • 1,579
  • 3
  • 17
  • 33
Bynd
  • 675
  • 1
  • 15
  • 40

1 Answers1

1

Better to mount the php.ini from the host, as docker-compose up will terminate the container and will launch a new container which does not container the modified php.ini.

volumes:
   - ./config/custom.php.ini:/etc/php(version)/apache2/conf.d/custom.php.ini

By default the scan directory for extra php files will look in the conf.d directory. These files will overwrite the settings of the main php.ini. I tested this with the asp_tag option turning it Off and On. It works fine as long as you do the following below.

The trick to making this work is to use docker-compose down instead of docker-compose kill

you can check further here and here

Adiii
  • 54,482
  • 7
  • 145
  • 148