Skip to content

Setting the PHP maximum upload file size

The upload_max_filesize directive in PHP controls the largest file size that can be uploaded through scripts (such as forms or CMS platforms). On ruachost.com, you can adjust this limit depending on your hosting environment.

  • Upload larger media files (images, videos, PDFs).

  • Support CMS platforms like WordPress, Joomla, or Drupal that require bigger upload limits.

  • Prevent errors such as:

    The uploaded file exceeds the upload_max_filesize directive in php.ini.

Create or edit a php.ini file in your application directory:

upload_max_filesize = 64M
post_max_size = 64M

Always set post_max_size equal to or larger than upload_max_filesize.

If your hosting environment supports .user.ini, add:

upload_max_filesize = 64M
post_max_size = 64M

On Apache servers, you can override the directive:

php_value upload_max_filesize 64M
php_value post_max_size 64M
  1. Log in to cPanel.
  2. Go to Software → Select PHP Version → Options tab.
  3. Locate upload_max_filesize and post_max_size.
  4. Increase values (e.g., 64M, 128M).
  5. Save changes.
  • Keep values reasonable to avoid excessive resource usage.
  • Match upload_max_filesize with post_max_size to prevent conflicts.
  • For very large files, also adjust max_execution_time and memory_limit.
  • Test uploads after making changes to ensure stability.