Unable to Install Modules Due to Size

So I have been banging my head against a wall for some time now. I have Dolibarr installed as a docker container on an Unraid Operating System. I am using MariaDB as an external database. I have purchased a module but I am unable to install it due to the file size being larger than 2 MB. I am needing to increase the max upload file size via PHP from 2MB to something a little more workable. I cannot for the life of me find where to change this setting. This is an ongoing issue, as most of the external modules are more than 2MB in size.

Hello,

This is not related to Dolibarr, but the infrastructure.
5s on google : How to override upload_max_filesize in php.ini in docker image - Stack Overflow

Thank you again ksar for the insight. I actually had to hit up ChatGPT on how to do this and was able to get it to successfully work. Below are the steps I took.

To increase the PHP max upload filesize for the Tuxgass/Dolibarr container from within Unraid without a text editor, you can follow these steps:

  1. Open the Unraid web interface and go to the Docker tab.
  2. Find the Tuxgass/Dolibarr container and click the “Terminal” icon to open a console session.
  3. In the console, type the following command to navigate to the directory where the PHP configuration file is located:

cd /usr/local/etc/php/conf.d/

  1. Type the following command to create a new configuration file:

touch custom.ini

  1. Type the following command to open the new configuration file in the console:

echo “upload_max_filesize = 100M” > custom.ini

Replace “100M” with the maximum upload filesize that you want to set.
6. Type the following command to restart the container so that the changes take effect:

docker restart <container_name>

Replace “<container_name>” with the name of the Tuxgass/Dolibarr container.

After completing these steps, the PHP max upload filesize should be increased for the Tuxgass/Dolibarr container.

2 Likes

Thank you for your clear explanation.
But, can you explain more “After completing these steps, the PHP max upload filesize should be increased for the Tuxgass/Dolibarr container.” at the last line of your answer?

Try setting it as an environment variable for your container.

Environment variables summary

PHP_INI_UPLOAD_MAX_FILESIZE	2M	PHP Maximum allowed size for uploaded files
PHP_INI_POST_MAX_SIZE	8M	PHP Maximum size of POST data that PHP will accept.

try setting one of those one at a time.

Thank you for your sincerely mention.
I think it refers to when installing or reinstalling. Is there a way to change the settings by just editing the configuration file (ini or conf) and restarting the daemon?

As you mentioned, I’ve tried but I just get the no change result and the custom.ini file is removed after docker restart? What do you think what I am wrong? hum…

It should not matter if you recreate the Dolibarr container, it should just reuse any persistent volumes or bind some external folders to internal folders at start.

And the database container can keep running even if you destroy the Dolibarr container.

There might be this method.

  1. enter into the container
  2. edit the relevant file
  3. stop and start the container

I think you should create your container with those environment variables that is suggested.

Thank you so much. I’ve solve the problem. Honestly, I don’t understand very well about the docker and containers. But finally, I understand that it is just a binary files. So you advise me to modify relevant file and restart container.
Thank you again for your help and your patient. :slight_smile: