How to change PHP limits in cPanel
Steps
- Log in to cPanel
- Scroll to Software
- Open MultiPHP INI Editor
- Choose your domain from the dropdown
- Modify the PHP directives you need:
memory_limitupload_max_filesizepost_max_sizemax_execution_timemax_input_vars
- Click Apply
Recommended Values (Typical Hosting)
| Setting | Suggested Value |
|---|---|
| memory_limit | 512M |
| upload_max_filesize | 256M |
| post_max_size | 256M |
| max_execution_time | 300 |
| max_input_vars | 5000 |
Method 2 — Editing .htaccess (If INI Editor is locked)
Works only if PHP is running as CGI/FastCGI.
Add this to your .htaccess:
php_value memory_limit 512M
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 300
php_value max_input_vars 5000
If you get a 500 error, your server doesn’t allow php_value overrides.
Method 3 — Creating/Editing php.ini or user.ini
Some hosts use php.ini, others use .user.ini.
php.ini
Create or edit:
memory_limit = 512M
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300
max_input_vars = 5000
.user.ini
Same values:
memory_limit = 512M
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 300
max_input_vars = 5000
Changes may take 5–10 minutes to apply.
Was this helpful?
Thanks for your feedback!