我们能为您提供什么帮助?

搜索我们的指南和教程,或浏览下方分类。

How to change PHP limits in cPanel

305 次浏览 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.

这对您有帮助吗?

感谢您的反馈!

仍需帮助?

如果上述内容未能解答您的问题,我们的支持团队全天候为您服务。