DirectAdmin

Change PHP settings (php.ini) and extensions in DirectAdmin

Raise memory_limit, upload size and execution time in DirectAdmin using the PHP settings page, .user.ini or the admin-level php.ini, and enable PHP extensions as admin.

IntermediateDirectAdmin2 min read

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

  1. Log in and select the domain.
  2. Go to Advanced Features → PHP Settings (shown on servers where the admin enabled it; CloudLinux servers may show Select PHP Version → Options instead).
  3. Change values such as memory_limit, upload_max_filesize, post_max_size, max_execution_time and max_input_vars.
  4. 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 = 256M

PHP 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

SettingTypical value
memory_limit256M (512M for large WooCommerce stores)
upload_max_filesize64M–128M
post_max_sizeSlightly larger than upload size
max_execution_time120–300
max_input_vars3000–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_ioncube

Use ./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_value lines; use .user.ini instead.
  • 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.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.