How to Modify PHP Memory Limit, Max Execution Time, and Upload Size in cPanel

40 views
Short answer: Go to cPanel Select PHP Version > Options tab, and increase memory_limit, upload_max_filesize, post_max_size, and max_execution_time to match application requirements.

Quickly increase upload_max_filesize, memory_limit, post_max_size, and max_execution_time using CloudLinux PHP Selector and .user.ini.

Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup

Quick reference

Interface cPanel > Software > Select PHP Version > Options Tab
Alternative File public_html/.user.ini
Recommended WordPress Values memory_limit = 512M | upload_max_filesize = 128M | max_execution_time = 300

Steps

  1. Open PHP Selector: In cPanel, navigate to Software > Select PHP Version.
  2. Switch to the Options Tab: At the top of the interface, click on the Options tab.
  3. Adjust Critical Directives: Click the value next to any directive to edit it:
    • memory_limit: Increase to 256M or 512M (essential for heavy plugins and WooCommerce).
    • upload_max_filesize: Increase to 64M, 128M, or 256M for large theme/plugin uploads.
    • post_max_size: Must be set equal to or greater than upload_max_filesize (e.g., 128M).
    • max_execution_time: Change from 30 to 120 or 300 seconds to prevent timeouts during imports.
    • max_input_vars: Increase to 3000 or 5000 for massive mega-menus or translated option tables.
  4. Save: Click anywhere outside the input box. CloudLinux saves the settings automatically.

Troubleshooting and tips

  • Values Not Applying via .htaccess: Change PHP values from the Options tab of Select PHP Version or in .user.ini. If adding php_value lines to .htaccess causes an HTTP 500 error, remove those lines.
  • Hard Limits: Shared hosting accounts have an upper physical memory ceiling governed by CloudLinux LVE. Setting memory_limit = 4096M will still be capped by your account's physical RAM quota (PMEM).
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket
Was this article helpful?
No, I need more help
Didn't find your answer?
Under 3 minutes
Submit Support Ticket