Changing PHP settings: memory_limit, upload size and execution time
Which PHP settings people usually need to change, how to find out which ones your account can adjust, and why server limits act as ceilings.
On this page
Some PHP settings can be adjusted per account on shared hosting; others are fixed for everyone’s security and stability. This guide shows how to check what applies, rather than promising particular values.
The settings people usually want
| Setting | Controls | Typical symptom when too low |
|---|---|---|
memory_limit | Memory one request may use | “Allowed memory size exhausted” |
upload_max_filesize | Largest single uploaded file | Upload rejected |
post_max_size | Largest total form submission | Upload fails silently; must be ≥ upload size |
max_execution_time | Seconds a script may run | “Maximum execution time exceeded” |
max_input_vars | Number of form fields accepted | Menus or settings pages don’t fully save |
Finding out what you can change
- Look in DirectAdmin for a PHP settings or configuration option near the PHP version selector, or search “PHP” in the panel search. If present, it shows which directives your account can edit.
- Try a
.user.inifile. Some server setups read a.user.iniinpublic_html:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 120Changes can take a few minutes to apply.
- Confirm the result with a phpinfo file — check the Local Value column. How to check which PHP version your site is using
Server limits are ceilings
If the server caps a value, asking for more has no effect, silently. If your change doesn’t show in phpinfo, that’s why.
Before raising a limit
Ask why it’s being hit. Well-behaved sites rarely need huge limits. A limit reached repeatedly usually points to one plugin or process doing too much at once. “Allowed memory size exhausted” PHP error
Choosing a host for a PHP project? Every Traxio account runs PHP 7.4 to 8.4 with a MySQL database: see PHP and MySQL hosting, £0.99 a month.
If it doesn’t work
These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.
- 500 Internal Server Error: how to fix itFind the real cause of a 500 error: read the error log, then check .htaccess, PHP errors, permissions and PHP version in order.
- Understanding PHP error messagesHow to read a PHP error: fatal errors, parse errors, warnings, notices and deprecations, what each means for your site, and where to look next.
- Blank white page: how to find the hidden errorA completely blank page usually means a PHP error that isn’t displayed. How to reveal it with logs and fix the cause.
Spotted something out of date or unclear? Tell us and we’ll fix it.