I recently updated, and I ran into Wordpress claiming there was a 32M upload limit. I already had the following manual config line where this was previously resolved.
php_admin_value[upload_max_filesize] = 128M
I tried adjusting the limit of the file upload in Wordpress via PHP-FPM Virtualmin Resource Limits. I used the value 128M. The UI then reported the upload limit was only 2M. This persisted after a reboot.
Hmm… I took a quick look for a system default. Been a couple decades since I’ve messed with this. I know there are some php.ini files in /usr/lib and I remember this drove me crazy decades ago. Just too many ini’s.
I’ve changed both settings to “128M” and restarted apache and php services. I’ve also tried rebooting via Webmin. Wordpress still shows “2M”. So, I’m not sure what’s going on with it, but it’s not applying the changes. If I set back to default values in VirtualMin, they do not go back to the default values (32M) and stick with these lower values (2M).
I also tried to change another Wordpress site that I have running. It was showing default (32M) upload, but upon adding ‘64M’ to both FPM fields resulted in the same issue. It’s now showing (2M) instead and doesn’t change if I set it back to default in Virtualmin.
Before making changes in VirtualMin, Wordpress correctly shows the default values in Site Health
Server architecture
Linux 4.19.0-26-cloud-amd64 x86_64
Web server
Apache
PHP SAPI
fpm-fcgi
PHP max input variables
1000
PHP time limit
60
PHP memory limit
256M
Max input time
60
Upload max filesize
32M
PHP post max size
32M
This is “site health” for Wordpress AFTER making changes via Virtualmin.
Server architecture
Linux 4.19.0-26-cloud-amd64 x86_64
Web server
Apache
PHP SAPI
fpm-fcgi
PHP max input variables
1000
PHP time limit
30
PHP memory limit
128M
PHP memory limit (only for admin screens)
256M
Max input time
60
Upload max filesize
2M
PHP post max size
8M
So… is VirtualMin missing something when it applies these changes? Surely there’s a way to debug this and figure out what’s happening.
also – find the xxxxxx.conf php-fpm config file for your specific Virtualmin virtual server and see if your value changes are actually in there.
and – but I’m a novice at this stuff – is it possible to have php settings in your .htaccess file, or in wp-config.php that will affect/override any of this??
There should be no overrides otherwise they would have overridden the defaults. This issue occurs when I edit ANY Virtualmin site.
UPDATE
On PHP Configuration where it lists all of the PHP init files. When I click ‘manage’ and edit any of the CGI/CLI versions, the values of 2M and 8M are set. When trying to change any of these, even setting the default radio button, it throws this error.
Failed to save resource limits : Missing or invalid maximum memory allocation
I then edited each of the files manually entering 128M for post and upload. Restarted apache and all php services. Wordpress still shows 2M/8M.
I’ve never had this issue before. I just upgraded a week or so ago to the latest version of Webmin/Virtualminm, so I think it has something to do with this.
UPDATE
I changed the PHP version for one of the Wordpress sites from 7.3 to 8.1. I then checked and the defaults of 32M were present. I then changed these to 128M in the GUI, restarted all, and it did not change. I then edited the PHP file manually and the 128M values are present in the file, but Wordpress/PHP are not seeing the changes. Seems like a VirtualMin BUG.
This kinda takes it outside VM. A VM bug would be the interface not recording the changes to the file, but, you have just bypassed the interface with the same result.
What OS and version are you using? Seems to be a soon obsolete mashup?
Well I set the same and if I look at the media uploads on WP it is the lowest of what in those 2 is used so its not a bug on my OS Rocky9. The conf file has remi (so a RHEL type OS) in the path so I presume your on a different OS, so the issue maybe with the OS where the settings Virtualmin settings are not working.
if you don’t see the little php icon hover close to the version number & it should appear. if nothing else this will show you which php.ini are being parsed and of course show what values are set for the variables that are wrong
I’ve checked that as well. These defaults are for 32M, but once the FPM config is changed the values are not referenced or used here. They should be read by the FPM config for the domain. In my case, that config is the one listed at the top of the previous screenshot, and Wordpress still reports 2M when they are changed.
Configuration File (php.ini) Path
/etc/php/8.1/fpm
Loaded Configuration File
/etc/php/8.1/fpm/php.ini
The FPM config should override this default domain config.
Just did it on my spare Ubuntu 22.04 system which worked fine, as I leave everything default (as Virtualmin set it) I am wondering if you have set something else within the php config that could cause it to fail ?
the config file ended up looking like
[16372518123538657]
user = user
group = user
listen.owner = user
listen.group = user
listen.mode = 0660
listen = /var/php-fpm/16372518123538657.sock
pm = dynamic
pm.max_children = 62
pm.start_servers = 8
pm.min_spare_servers = 1
pm.max_spare_servers = 31
php_value[upload_tmp_dir] = /home/user/tmp
php_value[session.save_path] = /home/user/tmp
php_value[error_log] = /home/user/logs/php_log
php_value[log_errors] = On
php_admin_value[memory_limit] = 256M
php_admin_value[post_max_size] = 64M
php_admin_value[upload_max_filesize] = 64M
Thanks for the info. My config is very similar with a few exceptions. This line in my config was taken from VM-Server Templates-Default-PHP Options-Additional PHP-FPM pool options. I used this to apply defaults to my domains without issue prior to the update.
include = /etc/php/7.3/fpm/pool.d/default.conf
The values in this file were correct, but removing the file reference from the domain’s PHP config got it working correctly. I entered the same values directly into the domain’s config and it still works fine. Not sure what the issue is now with using the include line in 'Additional PHP-FPM pool options. It’s a useful option.