PHP limits decide how large an upload can be, how long a script may run and how much memory it may use. In DirectAdmin you can change them per domain (users), or server-wide and with extra extensions (administrators). Picking the right PHP version per domain is covered separately in switch PHP version per domain.
Before you start
- Know which settings you need to change and why – for example a plugin requiring
max_input_vars = 3000. - Users need the PHP settings feature in their package; admins need root SSH for server-wide changes.
Users: PHP Settings page
- Log in and select the domain.
- Go to Advanced Features → PHP Settings (shown on servers where the admin enabled it; CloudLinux servers may show Select PHP Version → Options instead).
- Change values such as
memory_limit,upload_max_filesize,post_max_size,max_execution_timeandmax_input_vars. - Save. Changes apply within seconds with PHP-FPM.
Users: .user.ini file
With PHP-FPM, you can also create public_html/.user.ini with lines like:
memory_limit = 256MPHP reads it within a few minutes (controlled by user_ini.cache_ttl). Values cannot exceed limits the admin locked with php_admin_value. Note that php_value lines in .htaccess only work with mod_php, which modern DirectAdmin servers rarely use – they cause 500 errors under PHP-FPM.
Typical values
| Setting | Typical value |
|---|---|
memory_limit | 256M (512M for large WooCommerce stores) |
upload_max_filesize | 64M–128M |
post_max_size | Slightly larger than upload size |
max_execution_time | 120–300 |
max_input_vars | 3000–5000 |
Admins: server-wide php.ini
Each PHP version has its own file, for example /usr/local/php83/lib/php.ini. Edit it, then restart PHP-FPM: systemctl restart php-fpm83. Per-user overrides set in DirectAdmin are stored in the user's PHP-FPM pool configuration; rewrite configs with CustomBuild after template changes (./build rewrite_confs).
Admins: PHP extensions
Common extensions such as intl, imagick, redis or ioncube are installed with CustomBuild:
cd /usr/local/directadmin/custombuild && ./build set_php ioncube yes && ./build php_ioncubeUse ./build set_php imagick yes and ./build php_imagick in the same way. Check loaded extensions with /usr/local/php83/bin/php -m. See CustomBuild.
Check the active values
Create info.php with <?php phpinfo();, open it in a browser, search for the setting, then delete the file.
Troubleshooting
- 500 error after editing .htaccess: remove
php_valuelines; use.user.iniinstead. - Value ignored: the admin locked it, or the application sets its own limit.
- Extension missing: installed for a different PHP version than the domain uses.
