How can we help?

Search our guides and tutorials, or browse the categories below.

How to change PHP limits in cPanel

297 views Markdown

Steps

  1. Log in to cPanel
  2. Scroll to Software
  3. Open MultiPHP INI Editor
  4. Choose your domain from the dropdown
  5. Modify the PHP directives you need:
    • memory_limit
    • upload_max_filesize
    • post_max_size
    • max_execution_time
    • max_input_vars
  6. Click Apply

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!

Still Need Help?

Our support team is here around the clock for anything you can't find above.