Changing Maximum Upload Size

PHP/MySQL | Updated 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

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 March 2026 · Browse all PHP/MySQL articles

  • 548 Users Found This Useful

Was this answer helpful?

Related Articles

How Do I Update or Change My PHP Version

Hosting Control Panel | Updated March 2026 Ultra Web Hosting runs CloudLinux with multiple...

How do I import into a MariaDB - MySQL database?

PHP/MySQL | Updated 2026 Importing data into a MariaDB or MySQL database on your hosting...

phpMyAdmin - Error Incorrect format parameter

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

How do I change my PHP settings?

Updated 2026 Quick Answer To change PHP settings like upload_max_filesize,...

Cannot Connect to MySQL on Port 3306

PHP/MariaDB/MySQL | Updated March 2026 If you're getting connection errors when trying to...



Save 30% on web hosting - Use coupon code Hosting30