phpphpmyadminmod-php

Increase upload_max_filesize as a standalone setting just for phpmyadmin using php-fpm


is there a way to increase upload_max_file_size in phpmyadmin as a standalone php.ini using php-fpm? Does phpmyadmin support standalone php.ini?

when using mod_php, I'm able to use the following configuration in .htaccess:

php_value upload_max_filesize 128M

it works fine, but when using php-fpm, the php_value cannot be used and will trigger error. Example of the error:

/home/admin/domains/mydomain.com/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

When using php-fpm, I understand that I can edit the global setting here:

/usr/local/php74/lib/php.ini

But this changes also affect other application. So, my question is, is there a way to increase upload_max_filesize as a standalone setting just for phpmyadmin when using php-fpm ? Most of the answers online suggesting to edit the above php.ini file but I only want it to be standalone setting just for phpmyadmin.

Thank you.


Solution

  • The phpMyAdmin application itself doesn't care how you call it, if you have different PHP processes or FPM pools for different applications. As long as you properly configure the pools, phpMyAdmin won't even know about the other resources and certainly won't care that it's getting preferential file size settings.

    I actually do this, with several different sites I have completely different settings, including web root directories and so on. The way I accomplish this is by having several nginx configurations (which is made really easy because Debian gives me the /etc/nginx/sites-enabled directory, where I just symlink files from /etc/nginx/sites-available). So my nginx configuration for each site points to a different FPM sock file. In /etc/php/7.4/pool.d I configure each site that needs a specific configuration. So you'd need two fpm pools running, one for all your other sites and one for phpMyAdmin, and then configure nginx to use the appropriate sock file. I suspect Apache has some similar functionality, but haven't used php-fpm with Apache so I'm not sure about details.