domain.com/info.php not reflecting settings in Virtualmin>Services>PHP-FPM Configuration

Virtualmin>Server Configuration>website Options
Run CGI scripts as domain owner? Yes No
PHP script execution mode
CGI wrapper (run as virtual server owner)
FCGId (run as virtual server owner)
FPM (run as virtual server owner)
PHP FCGId sub-processes None
20
Maximum PHP script run time Unlimited
180
seconds



virtualmin>Virtual Server>Services>PHP-FPM configuration
[157298130131546]
user = wordpress
group = wordpress
listen = 8012
pm = ondemand
pm.max_children = 20
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
php_admin_value[upload_tmp_dir] = /home/wordpress/tmp
php_admin_value[session.save_path] = /home/wordpress/tmp
php_value[memory_limit] = 16M
php_value[session.save_path] = /home/wordpress/tmp
php_value[max_execution_time] = 180
php_admin_value[upload_max_filesize] = 32M
php_admin_value[post_max_size] = 32M



domain.com/phpinfo.php

System Linux host.domain.com.au 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64
Build Date Oct 26 2019 14:18:28
Server API FPM/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php/7.3/fpm
Loaded Configuration File /etc/php/7.3/fpm/php.ini
Scan this dir for additional .ini files /etc/php/7.3/fpm/conf.d



*Note two values for each represent “Local Value” and “Master Value”
max_execution_time 180 180
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 60 60
max_input_vars 1000 1000
memory_limit 4M 4M



Wordpress keeps throwing “exceeded max file upload size” error (file is only 7.12MB). Why are the above not lining up with each other for this virtual server? What am i missing here?

also, take a look at what wordpress says the php settings are…

WP Version: [?] 5.2.4
PHP Memory Limit: [?] 256 MB

Server Environment
Server Info: [?] Apache/2.4.25
PHP Version: [?] 7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0
PHP Post Max Size: [?] 8 MB
PHP Time Limit: [?] 180
PHP Max Input Vars: [?]
1000 - Recommended Value: 1500.
ZipArchive: [?] :heavy_check_mark:
MySQL Version: [?] 5.5.5
Max Upload Size: [?] 2 MB
DOMDocument: [?] :heavy_check_mark:
WP Remote Get: [?] :heavy_check_mark:
WP Remote Post: [?] :heavy_check_mark:

Is there an explanation for this?

plz post apache config, and /home/user/php.ini… could also be something server related… wordpress report is usually more correct…

about some settings :
memory_limit = 4M / 16M ??? can wordpress run with just 4M or 16M ? better set it to 128M as a min, IMHO…
also these :
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
have no effect with ondemand manager…

i dont have a local user account php.ini file.

In terms of the memory allocation, this is a new virtual server so I havent altered the virtualmin template or account plan yet. Having said that, wordpress runs just fine with the settings i have given it for now because if you look at my second post, you will notice that Wordpress actually has 256MB memory…not 4MB or 8MB as Virtualmin is indicating (and this is my entire point…Virtualmin hasnt a clue what is going on for some reason).

what i also cannot understand is how the wordpress system stats do not agree with phpinfo.php?
I have also checked /user/etc/php7.3/php.ini and settings are

System 7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0 memory_limit = 256M Post_Max_Size = 32M Upload_Max_Filesize = 32M

Now look again at what the Wordpress system status itself says settings are

PHP Version: [?] 7.3.11-1+0~20191026.48+debian9~1.gbpf71ca0 PHP Memory Limit: [?] 256 MB PHP Post Max Size: [?] 8 MB Max Upload Size: [?] 2 MB

How is this even possible?

For some reason, the user settings i am applying through Virtualmin are not being utilised…the system is overriding user settings in virtualmin. Something wrong here, surely that is not supposed to happen? (what is the point of having the ability to administer this in Virtualmin if the system is not even taking any notice of it? I suspect there is a virtualmin issue here…perhaps even a bug that needs fixing. I think i may need to put in a bug report unless Joe or erik can figure out why my install is doing this?

Could it be a case of the php settings are the hard limits - i.e. the max. And within that there are the Wordpress settings which should be less (but if they were more - couldn’t exceed the php limits)?

I am not sure…take a look at what the php-fpm settings are…

Edit Configuration Manually /etc/php/7.3/fpm/pool.d/157298130131546.conf
[157298130131546] user = wordpress group = wordpress listen = 8012 pm = ondemand pm.max_children = 20 pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 5 php_admin_value[upload_tmp_dir] = /home/wordpress/tmp php_admin_value[session.save_path] = /home/wordpress/tmp php_value[memory_limit] = 16M php_value[session.save_path] = /home/wordpress/tmp php_value[max_execution_time] = 180 php_admin_value[upload_max_filesize] = 32M php_admin_value[post_max_size] = 32M

what i am not understanding is this…why is the webserver not applying the above settings assigned in virtualmin>Services>PHP_FPM Configuration for the Virtualmin Virtual Server?

surely this is something wrong with Virtualmin coding as these settings are supposed to be the ones that are used by this account? (Otherwise why even have the option to configure this in virtualmin in the first place??)

Perhaps you guys can do a test for yourself…go into your system and set different php.ini settings for the above control panel areas and see which one your system applies to public_html. It should be the one assigned in Virtualmin>Services>PHP-FPM Configuration, but in my case its not doing that!

What i suspect is the problem is that in virtualmin, we still have to manually restart php-fpm 7.3 (in my case)? Perhaps an inclusion could be that this automatically happens if one uses virtualmin gui to makes changes to defaults?

use php_admin_value in fpm pool and retry… php_value can be overriden according to this : https://www.php.net/manual/en/install.fpm.configuration.php
also check my previous comment, some options have no effect with ondemand manager.

i suppose 2M upload limit could be in /etc/php/7.3/fpm/php.ini and doesn’t get overriden by php_value…