http://php.net/manual/en/configuration.changes.php
So should work at least with apache+mod_php. Instead of manipulating the .htaccess which comes with nextcloud it could be also done via nextcloud vhost inside <directory>
statement. But still, I don’t find a way to check for installed/activated php modules there. Will check, if syntax error arrives in case, or if the php settings are available/set anyway, in case without effect.
http://php.net/manual/en/configuration.file.per-user.php
And the .user.ini seems to be actually made for php values, as you even do not need php_flag/php_value. So this should work for php_fpm/nginx then.
Never learn out .