Site.eu
Back to Helpdesk
HELP CENTER ARTICLE
#Web hosting

Increase the PHP upload limit in DirectAdmin

Increase the PHP upload limit in DirectAdmin

Is a file too big to upload to your website? Then you've hit the PHP upload limit. Think of large images, videos, a theme, a plugin or a software update. Forms on your website have the same limit. A visitor who sends a bigger file may get an error. And some software needs a higher limit before you can install it.

The good news? You raise the limit yourself in DirectAdmin. It takes a few minutes.

Which settings matter?

Two PHP settings decide how big an upload can be. Always raise them together:

  • upload_max_filesize: the biggest file you can upload.
  • post_max_size: the most PHP accepts in one go. That's the file plus the rest of the form.

Think of a letter in an envelope. The file is the letter, post_max_size is the envelope. So set post_max_size higher than upload_max_filesize. And the lower of the two always wins. Say upload_max_filesize is 64M, but post_max_size is 16M. Then a file of 20 MB still fails.

And memory_limit? That's the memory a PHP script may use. PHP's own advice: keep it higher than post_max_size. Is it lower? Then raise it too, for example to 256M.

Which values? Choose a bit more than your biggest file. M stands for megabytes, G for gigabytes. For example: upload_max_filesize 64M and post_max_size 128M.

First: which kind of server do you have?

We have two kinds of web hosting servers, and the steps differ. Log in to DirectAdmin and open Extra Features in the menu. Do you see Select PHP version there? Then you're on a CloudLinux server. Otherwise, you're on a LiteSpeed server. Read more about our two kinds of servers.

On a LiteSpeed server: PHP Settings

Step 1: In DirectAdmin, search for PHP Settings and open it. At the top, check that the right domain name is selected.

Step 2: Under Add New Override, choose upload_max_filesize at Setting. At Value, choose the new limit, for example 64M. The values go up to 1G. Click Add.

Step 3: Do the same for post_max_size, with a higher value, for example 128M. Need a higher memory_limit too? Add it the same way.

On a CloudLinux server: Select PHP version

Step 1: In DirectAdmin, open Extra Features and click Select PHP version.

Step 2: Look at the field next to PHP version. Does it say native? Then you can't change PHP settings: a warning tells you so. Choose a version number and click Apply. Pick the number that native shows in brackets, like 7.4. Your website then keeps the same PHP version. Already a number there? Go on to step 3.

Want a newer PHP version? Read how to change your website's PHP version.

Step 3: Open the tab Options. Find upload_max_filesize and set it to the new limit, for example 64M. Then set post_max_size higher, for example 128M. Each change is saved right away. Wait for the short message that it's saved before you leave the page.

Check the new limit

Use WordPress? Go to Media and add a new file. Below the upload box, WordPress shows the maximum upload file size. That's the lower of upload_max_filesize and post_max_size. Want to see all three settings? Go to Tools, Site Health and Info. They're in the Server section.

Is your file too big even for the highest value? Think of a long video or a full backup. Then upload it with FTP. FTP doesn't use the PHP upload limit.

Still can't upload your file? Contact us by WhatsApp, Telegram or email.

Ready to search for your domain name?

Or , that's fine too!

Couldn’t find what you were looking for?

You can always chat with one of our experts for any questions you might have!

New articles added