PHP/MariaDB/MySQL

Changing Maximum Upload Size

Updated November 2026 11,128 views 4 min read
PHP/MySQL | Updated November 2026

If you are getting errors like "The uploaded file exceeds the upload_max_filesize directive" or "exceeds the maximum upload size for this site," you need to increase PHP's upload limits. On Ultra Web Hosting, you can do this through cPanel without editing php.ini directly.

01. Method 1: cPanel MultiPHP INI Editor

  1. Log into cPanel at my.ultrawebhosting.com
  2. Go to Software > MultiPHP INI Editor
  3. Select your domain from the dropdown
  4. Find and change these values:
    • upload_max_filesize - Maximum size of a single uploaded file (e.g., 128M)
    • post_max_size - Maximum size of the entire form submission. Set this higher than upload_max_filesize (e.g., 128M)
  5. Click "Apply"
Important Rule

post_max_size must be equal to or larger than upload_max_filesize. If post_max_size is smaller, uploads will fail silently regardless of the upload_max_filesize setting. A good practice is to set them to the same value.

02. Method 2: .htaccess

Add these lines to your .htaccess file in public_html:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
Note

The php_value directive in .htaccess only works when PHP runs as an Apache module. On our servers PHP runs via LSAPI, so this method may not work. If it causes a 500 error, remove these lines and use the cPanel method instead. See .htaccess guide for more.

03. Method 3: Local php.ini or .user.ini

Create a file named .user.ini (note the leading dot) in your public_html directory with these contents:

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300

Changes may take up to 5 minutes to take effect (PHP caches .user.ini files). This method works with all PHP handlers.

04. WordPress-Specific Settings

WordPress has its own upload limit that is separate from PHP's. If you changed the PHP settings but WordPress still shows a lower limit, add this to your wp-config.php file (before the "That's all" comment):

@ini_set('upload_max_filesize', '128M');
@ini_set('post_max_size', '128M');
define('WP_MEMORY_LIMIT', '256M');

You can also check the WordPress upload limit in the Media Library. When you click "Add New," the maximum upload size is displayed below the upload area.

05. How to Verify the Change

Create a file called phpinfo.php in your public_html with this content:

<?php phpinfo(); ?>

Visit yourdomain.com/phpinfo.php in your browser and search for upload_max_filesize and post_max_size. The "Local Value" column shows the current active setting.

Security

Delete phpinfo.php after checking. It exposes detailed server information that should not be publicly accessible.

Still Cannot Upload Large Files?

If you have changed the PHP settings and uploads still fail, there may be a web server or application-level limit in play. Open a ticket and we will check.

Open a Support Ticket

Frequently Asked Questions

How do I increase the maximum upload size?

On our hosting, use the cPanel MultiPHP INI Editor: select your domain and raise upload_max_filesize and post_max_size to the size you need. This changes PHP's limits without editing php.ini directly, and applies to WordPress and other apps.

Why do I get the uploaded file exceeds upload_max_filesize error?

Your upload is larger than PHP's upload_max_filesize, and possibly post_max_size, limit. Raise both values in the MultiPHP INI Editor, making sure post_max_size is at least as large as upload_max_filesize, then retry the upload.

How do I change the upload limit for WordPress?

The same PHP limits apply. Raise upload_max_filesize and post_max_size in the MultiPHP INI Editor, and if a plugin caps it, check its max-upload setting too. Then confirm the new limit on the WordPress media upload screen.

How do I verify the new upload limit took effect?

Create a page that calls phpinfo() and check upload_max_filesize and post_max_size, or in WordPress look at the Maximum upload file size on the Media Add New screen. If it did not change, confirm you edited the INI for the correct domain and PHP version.

Quick Recap

  1. Use MultiPHP INI Editor in cPanel - the most reliable method
  2. Set both upload_max_filesize and post_max_size - post_max_size must be >= upload_max_filesize
  3. Alternative: create a .user.ini file in public_html
  4. WordPress may need wp-config.php changes too
  5. Verify with phpinfo() - then delete the file

PHP configuration for your hosting account · Last updated November 2026 · Browse all PHP/MySQL articles

Share: X in Reddit f Email
  • 548 Users Found This Useful

Was this answer helpful?

Related Articles

The MySQL Server Is Currently Offline - DBCACHE Exit 11

Server Maintenance | Updated March 2026 When cPanel displays "The MySQL server is currently...

How to Add a User to a MariaDB/MySQL Database

PHP/MariaDB/MySQL | Updated November 2026 Every application that uses a database (WordPress,...

Increase PHP Memory

PHP/MySQL | Updated January 2026 If your website shows a "Fatal error: Allowed memory size...

phpMyAdmin - Error Incorrect format parameter

PHP/MariaDB/MySQL | Updated March 2026 The "Incorrect format parameter" error in phpMyAdmin...

PHP system exec Functions Disabled on Shared Hosting

PHP/MariaDB/MySQL | Updated November 2026 The error "Warning: system() has been disabled for...



Save 30% on web hosting - Use coupon code Hosting30