Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change PHP variables in Joomla docker official container

Tags:

php

docker

joomla

I am using the joomla official docker container. The problem is that I need to install a component but I receive the following error message:

Maximum PHP file upload size is too small: This is set in php.ini in both upload_max_filesize and post_max_size settings of your PHP settings

I know that I have to edit this PHP variables in order to install the component. I don't known where is the php.ini file. I already run the phpinfo() function and get the path for the php configuration file in

/usr/local/etc/php

The problem is there are no php.ini file.

How can I change these PHP variables? How to find the php.ini file in the official joomla docker container?

like image 811
miguelbgouveia Avatar asked Sep 06 '25 03:09

miguelbgouveia


2 Answers

You will have to provide your own php.ini file, and load that to the container as a volume. To do that, add the following flag to the docker run command:

-v local/path/to/php.ini:/usr/local/etc/php/php.ini

If you are using docker compose, update the volumes section of your joomla container definition to look like this:

joomla_container:
    ...
    volumes:
      ...
      - local/path/to/php.ini:/usr/local/etc/php/php.ini

You definitely shouldn't try to edit the configuration in a running container. If you do this, you'd lose your changes when you update the instance.

like image 179
Kuba Birecki Avatar answered Sep 07 '25 23:09

Kuba Birecki


Does the LOADED configuration file have a path in it? For example, mine is:

Configuration File (php.ini) Path   C:\Windows
Loaded Configuration File   C:\Windows\php.ini
like image 29
Tommy Avatar answered Sep 07 '25 23:09

Tommy