Knowledge Base

Fixing upload size and memory limit errors

These errors mean your website has reached one of its PHP limits. Most can be fixed in a couple of minutes in DirectAdmin.

Which setting to change

Error message Setting to increase
"The uploaded file exceeds the upload_max_filesize directive in php.ini" upload_max_filesize and post_max_size
"Allowed memory size of ... bytes exhausted" memory_limit
"Maximum execution time of 30 seconds exceeded" max_execution_time
Menu items or page builder changes aren't saved max_input_vars

Changing the setting

  1. Log in to DirectAdmin.
  2. Go to Extra Features and click Select PHP version.
  3. Open Options.
  4. Choose a higher value for the setting. Set post_max_size to the same as upload_max_filesize or higher.

Changes take effect almost immediately. See Changing your PHP version and settings for more detail.

WordPress memory

WordPress has its own memory limit, which can be lower than PHP's. If you still see memory errors after raising memory_limit, add this line to wp-config.php, above the line that says "That's all, stop editing":

define( 'WP_MEMORY_LIMIT', '256M' );

The value can't be higher than your PHP memory_limit.

Checking your current limits

In WordPress, go to Tools > Site Health > Info and open the Server section to see your current upload size, memory limit and execution time.

Still too small?

  • Very large files, such as videos, are better uploaded by FTP or hosted on YouTube or Vimeo and embedded in your website.
  • "413 Request Entity Too Large" means the upload is bigger than the server allows. Upload the file by FTP instead, or open a Technical Support ticket.
  • The highest values available depend on your plan. If you regularly need more, see Upgrading or downgrading your hosting plan.

We'll do our best to help troubleshoot WordPress, plugins, themes and other third-party software, but for in-depth help, please contact the software's developer or its official support forum.

Please rate this article to help us improve our Knowledge Base.

0 0