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