Increasing File Upload Limits (upload_max_filesize & post_max_size)

Sometimes a client may need to upload larger files to their website or hosting account — for example, when installing CMS themes, uploading backups, or importing data.
In such cases, you can increase the PHP upload limits directly from cPanel or using the PHP Manager feature.


🧭 Option 1: Using cPanel (Select PHP Version or PHP Manager)

  1. Log in to the client’s cPanel.

  2. Locate and click on “Select PHP Version” or “PHP Manager” (depending on the theme used).

  3. Inside the PHP Selector, click on “Options” or “PHP Settings.”

    1. Look for the following directives:

      upload_max_filesize

      post_max_size

      (optional) memory_limit

      (optional) max_execution_time

      Click the current value and increase it (for example, from 8M to 128M or higher, depending on the client’s need.

  4. Once edited, the changes are applied automatically. No server restart is required.

🟢 Tip:
Make sure post_max_size is always equal to or greater than upload_max_filesize; uploads may still fail.




⚙️ Option 2: Editing via PHP.ini or .user.ini

If the PHP Manager option is not available, you can manually edit the PHP configuration file:

  1. In cPanel → File Manager, go to the public_html directory (or the specific site folder).

  2. Check if a file is named .user.ini or php.ini exists. If not, create one.

  3. Add or update these lines:

    upload_max_filesize = 128M
    post_max_size = 128M
    memory_limit = 256M
    max_execution_time = 300
  4. Save the file.

  5. If the website uses caching or a CMS (like WordPress), clear the cache and retest the upload.


🧩 Option 3: Using .htaccess (for Apache servers)

If the above methods don’t work, you can use .htaccess:

  1. Open or create the .htaccess file inside the website root folder.

  2. Add the following lines:

    php_value upload_max_filesize 128M
    php_value post_max_size 128M
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_value max_input_time 300
  3. Save changes and test the upload again.

⚠️ Note:
Some hosting environments may restrict these overrides.
If an error 500 appears after saving, remove the added lines — the server may not allow custom PHP values in .htaccess.


✅ Verification

After applying any of the methods above:

  1. Create a simple PHP file called phpinfo.php inside the public_html folder:

    <?php phpinfo(); ?>
  2. Access it from your browser (https://domain.com/phpinfo.php)

  3. Check the current values for:

    • upload_max_filesize

    • post_max_size

    • memory_limit

If the values are updated, the configuration was applied successfully.
Finally, delete the phpinfo.php file for security reasons.


🔐 Support Best Practice

If the client requests this change:

  • Confirm whether the plan or hosting package supports custom PHP limits.

  • Apply the changes through their cPanel only (never directly via root SSH unless authorized).

  • Record the action in Admin Notes on the client’s WHMCS profile for tracking.