Updated: 15 November 2026 · Applies to: DirectAdmin with CloudLinux PHP Selector or PHP-FPM; tested with PHP 8.4

To raise post_max_size in DirectAdmin, open Select PHP Version (CloudLinux PHP Selector), go to its Options tab and set a bigger value such as 64M. On a server without CloudLinux that runs PHP-FPM, put the setting in a .user.ini file in your site folder instead. Either way, keep it larger than upload_max_filesize.

What post_max_size does

post_max_size is the largest form submission PHP accepts, counting every field and every uploaded file together. PHP's default is 8M. According to the PHP manual, it must be larger than upload_max_filesize (default 2M) for big uploads to work, and memory_limit should generally be larger than post_max_size.

When a submission is too big, PHP does not show an error on the page. It simply throws the whole request away, so $_POST and $_FILES arrive empty. That is why an oversized upload often looks like "the form did nothing" or "the file was not selected".

Method 1: CloudLinux PHP Selector

  1. Log in to DirectAdmin (usually https://your-server:2222; the address is in your welcome email).
  2. Open Select PHP Version, usually found under Extra Features.
  3. Open the Options tab.
  4. Find post_max_size and choose a larger value, for example 64M. Set upload_max_filesize a little lower, for example 32M, if you are raising it too.
  5. Save the change if your panel shows a save button, then test the form again.

The options are tied to the PHP version you selected in the same tool. If you switch PHP version later, check the values again. The same tool changes the PHP version itself, see How to Change PHP Version Using CloudLinux Selector in DirectAdmin.

Method 2: a .user.ini file (PHP-FPM, no CloudLinux)

If your account has no Select PHP Version icon, the server probably uses DirectAdmin's own PHP handling. DirectAdmin's documentation notes that PHP-FPM does not read PHP settings from .htaccess, but does read a user-controlled .user.ini file. Create a file named .user.ini in the folder of the site, for example domains/example.com/public_html, with File Manager or FTP:

post_max_size = 64M
upload_max_filesize = 32M

PHP caches .user.ini files for up to 300 seconds by default (user_ini.cache_ttl), so the new values can take up to five minutes to apply.

Check that the new limit is active

Create a small test file, for example limits.php, in the same folder:

<?php
echo "post_max_size=", ini_get('post_max_size'), " upload_max_filesize=", ini_get('upload_max_filesize'), " memory_limit=", ini_get('memory_limit'), "\n";

Open it in the browser. In our lab test (Debian 13, PHP 8.4.27 with PHP-FPM and nginx), the page showed the defaults before the change:

post_max_size=8M upload_max_filesize=2M memory_limit=128M

and the new values once the .user.ini file was picked up:

post_max_size=64M upload_max_filesize=32M memory_limit=128M

Delete the test file when you are done, so it does not reveal your settings to visitors.

How to spot this limit in the logs

In the same lab test, sending a 12 MB upload to the default 8M limit left $_POST and $_FILES empty and wrote this warning to the error log:

PHP Warning:  PHP Request Startup: POST Content-Length of 12000315 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

If you see "POST Content-Length ... exceeds the limit", raise post_max_size. If the upload is under post_max_size but one file is bigger than upload_max_filesize, raise that one instead: see How to Increase PHP upload_max_filesize in DirectAdmin. Very large imports may also need more memory: see How to Adjust PHP Memory Limits in DirectAdmin Using CloudLinux Selector.

If the value will not go higher

Your hosting plan may cap the highest value you can choose, and the web server can have its own request size limit in front of PHP. If you need a bigger limit than the panel allows, open a support ticket and say which site and what upload size you need.

Official documentation: PHP manual, core php.ini directives and DirectAdmin, PHP options.

Related services

Server management

on-demand administration, hardening, migrations and monitoring.

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Was this answer helpful?

Still stuck? Open a ticket