How to Increase PHP Upload Limit, Memory & Post Max Size

In some cases, default server settings may not let you upload larger files via your website, or your website requires a little more power to function. This tutorial shows how to increase PHP upload limit, memory or post max size in cPanel or by modifying .htaccess file.

What you’ll need

Before you begin this guide you’ll need the following:

- Access to your hosting account’s cPanel


- Ability to connect via FTP client

Option 1 – Increasing PHP upload Limit, Memory & Post Max Size in cPanel

If you don’t have access to cPanel, please refer to Option 2.

Step 1 — Opening up PHP Settings

Log in to your cPanel and navigate to Select PHP Version –> Switch to PHP Options:

Select PHP Version

Switch to PHP Options


Step 2 — Changing Upload Limit values 

Let’s say you are having an error while trying to upload 19 Mb WordPress theme file through your WordPress Admin Area.

The following configuration illustrates appropriate settings for this example: 

  • Set memory_limit to 128Mmemory_limit describes the maximum amount of memory a script can allocate. It is recommended to set this to maximum available value. Letter stands for megabytes.
  • Set upload_max_filesize to 64Mupload_max_filesize describes a maximum size of an uploaded file. It must be larger than the theme file mentioned in the example.
  • Set post_max_size to 64Mpost_max_size has a similar functionality to upload_max_filesize. Make it larger than 19 MB (theme file) as well.


Increasing Upload Limits

 Don’t forget to Save the changes.


IMPORTANT! Your cPanel may be a bit different and you may not have found Select PHP Version section. Consult your hosting provider about modifying PHP variables.


Alternatively you can use cPanel’s File Manager to locate .htaccess file and modify it accordingly. Refer to Option 2 for explanations.


Option 2 – Increasing PHP Upload Limit Using .htaccess 

If there is no possibility to edit PHP settings via your cPanel, you can use another method which involves editing your .htaccess file by connecting via FTP Client. 

Note that .htaccess file is a hidden file, therefore you would need to enable its visibility. 

Add the following lines to .htaccess file to increase upload limit: 



You have learned how to increase PHP upload limit, memory & post max size in cPanel. You have also learned an alternative method to accomplish that using .htaccess file by connecting via FTP Client. 

Note that your website settings may be overriding server configuration. In this case, you would need to configure these settings separately.


  • 32 Users Found This Useful
Was this answer helpful?

Related Articles

How to update your cPanel Contact Information or receive a notification on reaching quota limit?

If you want to receive notification on reaching your disk quota, bandwidth usage limit, reaching...

How to Change cPanel Style/Theme?

Switching over to another cPanel theme with a different style is easy and there are two ways to...

How to Edit file in the cPanel File Manager?

1. Log into your cPanel account.2. In the "Files" section, click on "File Manger" Icon. 3....

How to Change Language of your cPanel?

cPanel supports a lot of languages, and if you want to change your cPanel language to your native...

How to Reset my cPanel Account Password?

If you can access your cPanel account, follow these steps to reset your password:1. Log into your...