Max File Upload Size not being correctly reported in phpmyadmin on Virtual Servers

Ubuntu Linux 20.04.3
Webmin 1.981
Virtualmin 6.17.3

We have been struggling with this issue for a couple of weeks now and the only relevant search results were previous posts on the Virtualmin forums back in 2018 and 2019, neither of which have actually had any solutions posted >

We have tried installing on root domain as a script and also on a subserver domain via the script. We even tried installing phpmyadmin completely from the command line on the root domain. All had the same result - they were stuck with the limit of 2M.

We have updated every php.ini file, have checked the Resources page for each relevant php version within Virtualmin - all of these are set to 8M with a memory limit of at least 512M

Other forums like Stackoverflow have many answers which point out all of the normal solutions that we have already done (as above).
Is it possible there is an issue with Virtualmin (we have used VM for years without this issue before) ?

Grateful for any new ideas as we are lost as to how to solve this.

Did you restart Webmin after the changes were made?

Can you be specific. Where and what path been used to amend php.ini? as an example:

/etc/php/7.0/apache2/php.ini [On Debian/Ubuntu]

upload_max_filesize = 10M
post_max_size = 10M

If you are using php-fpm, check the php.ini for the individual domain also.

As said above restart apache.

You could try:

  1. create a php file with <? phpinfo(); ?>
  1. Look for ā€œScan this dir for additional .ini filesā€.
  2. Go to the above directory and create user.ini file like:-
 post_max_size = 500M
 upload_max_filesize = 500M
  1. Restart Apache sudo service apache2 restart
  2. Reload the phpinfo(); file

An try this too, as an example:

`āžœfind /etc -name ā€˜php.iniā€™
/etc/php7/cli/php.ini
/etc/php7/cgi/php.ini
/etc/php7/apache2/php.ini
/etc/php7/embed/php.ini
/etc/php7/fpm/php.ini

Hi Gomez,
Yes we did and have even tried restarting the whole server. Alas still the limit says 2M limitā€¦

@TTKDeveloper,

Which PHP execution mode are you running? FPM is recommended and the configuration can be adjusted via Virtualmin under:

Virtualmin > Services > PHP-FPM Configuration > Resource Limits

This page updates the file located at:

/etc/php/7.4/fpm/pool.d/DOMAIN_ID.conf

If you try to update any other PHP configuration you will likely not see any changes as Apache isnā€™t even using this alternate configuration generally speaking.

Hint: At the top of ā€œVirtualmin > Services > PHP-FPM Configuration > Resource Limitsā€ it shows you the location of the configuration file.

BTW: these instructions are for Ubuntu 20.04 LTS

1 Like

We are using FCGId as FPM.
I would have attached a screenshot of the Resources Limits page for you but I could not attach it to this post. Memory : 512M, Max upload: 8M, Max input time 60s, Post size: 8M and max execution : 30s.

The file you referred to does not exist in the setup - there is only one file in pool.d folder which is called www.conf

The server is Ubuntu 20.04 LTS so we are on the same page.

@TTKDeveloper,

I would recommend using FPM vs FCGId as it is built into the PHP project natively and essentially supercedes FCGId which was implemented prior to the adoption of FPM.

You can change the execution mode by visiting:

Virtualmin > Server Configuration > PHP Options

There are IMHO very few situations where FCGId actually is better.

Thanks for the advice - well founded. We have changed the execution and restarted webmin, then logged back into phpmyadmin. The limit still says 2M limit :frowning:

Every execution mode has PHP config in a different place. I donā€™t like it, but itā€™s necessary because of how each of them works.

FPM configs live inā€¦I think /etc/php-fpm.d/domain-id.conf (might be different on Ubuntuā€¦thatā€™s definitely where it is on CentOS).

The config items youā€™re looking for probably get set with something like php_value[post_max_size, I think? You may need to do a bit of googling to figure out whether thatā€™s the case (itā€™s too late for me to go spelunking at the moment).

You also have to restart the php-fpm service, not the web server, to make these changes take effect (PHP runs under the FPM service, rather than the web server in the FPM execution mode).

Hi Joe,
Went in search of those settings and they are different on Ubuntu - /etc/php/7.4/fpm/conf.d/php-fpm.conf and a php.ini. The php-fpm.conf had no references to post_max_size and the php.ini values all matched those we can see in the Resources page. We then went searching under the domain name settings - just in case - home/domain/etc/php7.4/php.ini which again has the same limits in it as we see on the Resources page.
It simply looks like Virtualmin and the system are working as they should, its just phpmyadmin that seems to be pulling the wrong config from ā€¦

Shouldnt your php-fpm.conf have those references added? Under services ā†’ PHP-FPM Configuration - Memory and transfer limit options are they set as default or edited?

1 Like

Yes - finally a resolution! Thankyou so much for your patience and help.
The file FYI was /etc/php/7.4/fpm/pool.d/163241363065021.conf ā† so not really a file we would have looked for as such!

@TTKDeveloper,

I guess you missed my post which told you where to find the configuration file when using FPM execution mode.

2 Likes

What you should have used is Virtualmin UI for changing PHP resources on virtual-server.local - Services ā‡¾ PHP-FPM Configuration: Resource Limits page.

Example:

Youā€™re right, having default limits for phpMyAdmin is painful. I will update install script to raise the limits for the new installs.

3 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.