PHP has a number of configurable limits that affect how your website runs. When these limits are too low, you'll see errors like:
This article covers the most commonly adjusted PHP limits, what they do, and how to change them yourself using the tools in cPanel and DirectAdmin.
| Directive | Purpose | Typical Default | Common Adjusted Value |
|---|---|---|---|
memory_limit |
Maximum memory a single PHP script can use | 128M | 256M or 512M |
upload_max_filesize |
Maximum size of a single uploaded file | 2M or 64M | 128M or 256M |
post_max_size |
Maximum size of all POST data (must be ≥ upload_max_filesize) | 8M or 64M | 128M or 256M |
max_execution_time |
Maximum seconds a script can run | 30 | 120 or 300 |
max_input_time |
Maximum seconds PHP spends parsing input data | 60 | 120 or 300 |
max_input_vars |
Maximum number of input variables (fields in forms, etc.) | 1000 | 3000 or 5000 |
Important relationships:
post_max_size must be greater than or equal to upload_max_filesize.memory_limit must be greater than or equal to post_max_size.memory_limit ≥ post_max_size ≥ upload_max_filesize.cPanel offers several ways to adjust PHP limits. The MultiPHP INI Editor is the preferred method for most customers.
This is the easiest and most reliable method.
php.ini content.memory_limitupload_max_filesizepost_max_sizemax_execution_timemax_input_timeChanges take effect immediately for that domain.
If the directive you need isn't in MultiPHP INI Editor (like max_input_vars), use the PHP Selector:
If you need fine-grained control or the above tools don't expose a specific directive:
public_html/).php.ini file already exists. If not, click + File to create one, and name it php.ini.php.ini and choose Edit.memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
max_input_vars = 3000
Note: On servers using CloudLinux/CageFS, a php.ini in your site root may not be read. In that case, use Select PHP Version → Options instead.
On some cPanel configurations, PHP reads from .user.ini files. The process is identical to Method 3 but the filename is .user.ini instead of php.ini.
If your server runs PHP as an Apache module (mod_php, which is rare on modern cPanel), you can set limits in .htaccess:
php_value memory_limit 256M
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
Important: This only works with mod_php. On most modern cPanel servers (which use PHP-FPM, LiteSpeed, or suPHP), these directives will cause a 500 Internal Server Error. If you see this error after adding them, remove the lines immediately. Use MultiPHP INI Editor instead.
DirectAdmin's PHP configuration is usually handled through the PHP Selector (on CloudLinux servers) or directly via custom php.ini files.
memory_limitupload_max_filesizepost_max_sizemax_execution_timemax_input_timemax_input_varsIf PHP Selector isn't available or doesn't expose the directive you need:
domains/yourdomain.com/public_html/.php.ini (or edit the existing one).memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300
max_input_time = 300
max_input_vars = 3000
Some DirectAdmin configurations use .user.ini instead of php.ini. If php.ini doesn't work, try creating .user.ini with the same contents in the same location.
DirectAdmin allows per-domain PHP settings on some servers:
This method varies significantly by server configuration; if you don't see it, use Method 2 or 3.
After adjusting PHP limits, confirm they've taken effect.
phpinfo.php.<?php phpinfo(); ?>
yourdomain.com/phpinfo.php in your browser.memory_limit).Important: Delete phpinfo.php after verifying. Leaving it accessible is a security risk — it exposes details about your server environment that could help an attacker.
If you're on WordPress:
PHP memory limit, PHP max input time, PHP max execution time, and more.Plugins like WP-ServerInfo or Query Monitor display active PHP limits directly in the WordPress dashboard.
Adjust these three together:
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 512M
Start with memory_limit = 256M. If the error persists, try 512M.
max_execution_time = 600
max_input_time = 600
Some backup and import plugins also have their own internal timeout settings — check the plugin's settings page as well.
Increase max_input_vars:
max_input_vars = 5000
This is common with large WooCommerce products, Gravity Forms, or page builders like Elementor with many settings.
This is a web server limit, not PHP. It's often caused by nginx, LiteSpeed, or Apache's LimitRequestBody directive, not upload_max_filesize. If adjusting PHP doesn't help, open a ticket — we may need to increase the web server limit.
Your hosting plan or the server's global configuration may cap certain limits. For example, if the server allows a maximum memory_limit of 512M, setting 1024M in your php.ini won't actually give you 1024M — it'll be silently capped at 512M.
If you need a limit raised above what the server allows, contact support with your use case.
Adjusting PHP limits in cPanel or DirectAdmin only affects your account — it doesn't impact other customers on the server.
On servers using PHP-FPM (most modern setups), changes take effect immediately for new requests. You don't need to restart anything.
On cPanel, each addon domain or subdomain can have its own PHP settings. Use MultiPHP INI Editor to configure them individually if needed. A php.ini in the root of each domain's document root will apply to that domain only.
Try the self-service methods first — they cover nearly every case. Open a ticket if:
When opening a ticket, please include: