How to Increase the Max Upload Filesize and Post Max Size in DirectAdmin’s PHPMyAdmin PHP.ini

Posted on

HelloTo increase the maximum size of a database that can be uploaded in DirectAdmin’s PHPMyAdmin, one must edit the used PHP version’s php.ini to adjust the setting, and then restart the appropriate services. The examples given below apply to a DirectAdmin server using PHP-FPM as the PHP handler.

1) Find the default PHP version’s php.ini

You can run the following command to find out what configuration files are in use on your server and what their locations are:

/usr/local/directadmin/custombuild/build used_configs

PHPMyAdmin on DirectAdmin will use the default PHP version. There may be a blank php.ini section in the output of the command above, but you can ignore that as we just want to know the default PHP version and the location of its php.ini file.

2) Edit the php.ini

Now that you can see the location of the default PHP version’s php.ini file, you can now edit it to increase the post_max_size and the max_upload_filesize variables.

Using the example in the image above, you could use this command via SSH as root to edit the file:

nano /usr/local/php73/lib/php.ini

Note that the upload_max_filesize determines the Mib displayed in PHPMyAdmin, but you’ll want to increase both.

3) Restart the webserver and any related services

Now you need to restart the webserver and any related services to ensure the changes take place.

Apache:

service httpd restart

If using php-fpm, restart it (replace XX with the appropriate version of PHP, e.g., php-fpm73):

systemctl restart php-fpmXX

Then Check your results.