Chapter 14 · 14.3
PHP options: upload_max_filesize, memory_limit and max_execution_time
Watch it in a short video
PHP comes with settings that determine what a script is allowed to do: how large an upload may be, how much memory a script may use and how long it may run. You adjust these yourself in Select PHP version, on the Options tab. So you don't need a php.ini or rules in .htaccess.
How to change an option
- In DirectAdmin, under Extra Features, click Select PHP version.
- Check that the correct version is selected under PHP version. Options are set per version.
- Click the Options tab.
- Click the value next to the option you want to change and choose or type the new value.

The new value is saved immediately and applies straight away to all websites in your package that use this PHP version.
The most important options
| Option | What does it do? | When should you increase it? |
|---|---|---|
| upload_max_filesize | How large a single uploaded file may be. | If you want to upload a large theme, a video or a backup and you get a message that the file is too large. |
| post_max_size | How large everything sent at once (file plus form) may be together. | Always together with upload_max_filesize. Make post_max_size at least as large, preferably slightly larger. |
| memory_limit | How much memory a single PHP script may use. | With the message "Allowed memory size of ... bytes exhausted" or if a plugin asks for more memory. 256M is more than enough for most sites. |
| max_execution_time | How many seconds a script may run before it's stopped. | With an import, export or migration that stops halfway with "Maximum execution time exceeded". |
| max_input_time | How long PHP may take to receive an upload or form. | With large uploads over a slow connection. |
| max_input_vars | How many fields a form may have. | If a large menu or a page with many options in WordPress isn't fully saved. Set it to, for example, 3000 or 5000. |
| display_errors | Shows PHP errors on the page itself. | Only temporarily, to track down an error. Turn it off again afterwards: visitors don't need to see your error messages. |
| date.timezone | The time zone for dates and times. | Already set to Europe/Amsterdam. Only change this if your site needs to work in a different time zone. |
Please note: Higher values aren't always better. A script that needs a lot of memory or time counts towards your package's limits (see Resource Usage: CPU, memory and processes). So only increase a value if needed, not "just in case" set it to the maximum.
An example: uploading a large file
You want to upload a 200 MB backup using a migration plugin, but you get a message that the file is too large. In that case, set:
- upload_max_filesize to 256M;
- post_max_size to 256M or higher;
- if needed, max_execution_time and max_input_time a bit higher, for example 300.
Then refresh the plugin's page. The new limit usually shows up straight away. If it still doesn't work, read Upload too large (error 413) or timeout.
Can I do this in My WebOké too?
Yes, for the most commonly used options. Ask the AI assistant in My WebOké, for example, "Set upload_max_filesize to 256M". The assistant can change memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_time, max_input_vars and display_errors for you in Select PHP version, for the PHP version your package is currently using. You'll see what will change first and then click Approve and carry out yourself.
Frequently asked questions
I've increased the value, but my site still shows the old value.
Check that you changed the option for the version marked (current). Also check whether your .htaccess still has an old rule such as php_value upload_max_filesize, or whether there's an override for your domain under PHP Settings (see PHP Settings in DirectAdmin or Select PHP version: what's the difference?). These take priority.
What's the maximum?
On the Options tab, some options only let you choose from a list. Need more than you can choose there, for example for a large import? Then you can set a higher value with a rule in .htaccess (see PHP settings per directory and via .htaccess), or open a ticket.
Why are disable_functions and open_basedir listed here?
These are there for the security of your website and the server. Leave them as they are.
