Skip to content
novasean.

DirectAdmin

Change a PHP memory limit in DirectAdmin

Check a site’s effective PHP memory_limit, use an available DirectAdmin setting safely, and verify the change within your hosting limits.

By Team Novasean · Published

Understand what the PHP memory limit controls

PHP memory_limit sets the maximum memory a single PHP script may allocate. It is not a measure of all available server RAM, an account-wide memory allowance or a promise that a script can use the full value at once. Several simultaneous requests can each use memory, so a very high limit can increase pressure on a shared server or VPS.

Increase the value only after confirming a real memory-exhaustion error and checking what the application was doing. A larger limit may help a legitimate import or report, but it can also hide an inefficient plugin, an oversized task or a memory leak. Never set the value to unlimited as a first response.

Confirm the error and the website’s PHP runtime

  1. Record the domain, the action that failed and the time it happened.
  2. Check the application or PHP error log for an explicit message such as Allowed memory size exhausted. A generic HTTP 500 or blank page alone does not prove that the memory limit caused it.
  3. Confirm the PHP version and handler selected for this domain in DirectAdmin. Command-line PHP tools may use a different binary and configuration from a web request, so a CLI result does not by itself tell you the website’s effective limit.
  4. If the problem affects an import, backup or other large operation, check whether the application can process smaller batches before raising a server-side limit.

A public phpinfo() page exposes server configuration. Do not leave one publicly accessible. Prefer the application’s own diagnostics; if a temporary diagnostic is essential, restrict access, show only the needed value and remove the file immediately after testing.

Change the domain setting in DirectAdmin if it is available

  1. Sign in at User level and select the correct domain. Look for PHP Settings or the domain’s PHP configuration; menu wording varies by DirectAdmin skin and server setup.
  2. Find memory_limit and note its current value. If the option is available, choose a modest value that matches the application vendor’s requirement and remains within the range the panel permits.
  3. Before saving, confirm whether the setting applies only to this domain. Depending on the DirectAdmin PHP mode, PHP-FPM setup and panel version, settings may be shared across domains using the same account or FPM configuration. Ask your provider if the scope is unclear, especially when the account hosts several sites.
  4. Save only after confirming the scope, then wait for the web handler to apply it. Retest the failing action and check every other site that may share the setting.
  5. Repeat the same web request that failed and check the application or PHP log again. Confirm that the effective web value changed and the operation now completes without a new error.

DirectAdmin options depend on the installed PHP handler, server configuration and account permissions. If the setting is missing, locked or capped, stop and ask the hosting provider what the account allows. Do not edit a server-wide php.ini, administrative custom HTTPD configuration or restart PHP-FPM from a customer account.

Use a .user.ini file only when your host supports it

Some CGI and PHP-FPM setups allow per-directory overrides through .user.ini; other handlers or host policies may not. DirectAdmin and PHP documentation both describe configuration differences by handler, so first confirm with your provider that this file is enabled for the selected domain and that memory_limit can be overridden.

If the provider confirms it is supported and gives you a permitted value, a file in the applicable document-root path may contain a line such as memory_limit = 256M. This is an illustration, not a Novasean package limit or recommended value. Use the value agreed for your application and service. Do not also add conflicting PHP directives in .htaccess; those directives are not supported by every PHP handler and can cause an HTTP 500 error. A .user.ini change may be cached for a short period, depending on server configuration, before new requests use it. Do not put credentials or secrets in this file. Ask your provider how direct web requests to dotfiles are handled, and verify that requesting the file over HTTPS does not reveal its contents. If it does, remove the file and contact support.

If the effective value does not change

  • Check that you edited the settings for the exact domain and selected PHP version that serves the failing page.
  • Confirm that the application request uses the web PHP handler, not a command-line configuration.
  • If you used .user.ini, verify that the provider enabled it, that it is in the right document-root path and that the handler’s cache interval has passed.
  • If the value is capped or the panel does not offer the setting, ask the host before trying another configuration method.

When contacting support, include the domain, selected PHP version, the setting shown in DirectAdmin, the value reported by the application, the time of the failure and a sanitised error excerpt. Never send passwords, private keys or full configuration dumps.

Common questions

Does a higher PHP memory limit add RAM to my hosting account? No. It changes the per-script cap; it does not add physical memory or remove other service limits.

Can I be sure this setting affects only the selected site? Not always. DirectAdmin’s PHP mode, FPM configuration and panel version determine whether a setting is domain-specific or shared. Ask the provider to confirm the scope before saving, then test other sites that may use the same configuration.

Can I use the same value for every site? No. Requirements, account limits and PHP handlers differ. Use the application vendor’s guidance and the options available to the relevant site or shared configuration.

Why does PHP CLI show a different limit? CLI and web requests can load different PHP versions or configuration files. Verify the value through the website’s own diagnostics or an approved, restricted test.

Will increasing the value always fix the error? No. The script may have an inefficient query, a large batch or a code defect; the host may also enforce a lower cap. Diagnose the failing operation before raising the limit.

Sources and technical references

Prepared by Team Novasean from the references above. Menus and available features depend on your installed version and service permissions.

Related guides

Was this guide helpful?

If you accepted optional analytics, your Yes/No answer and this guide’s page address are sent to Google Analytics. No written feedback is collected. Read our privacy statement or change your choice in .

Need help with your service?

Open your client area or contact Novasean. Describe the symptom and checks you have performed. Keep passwords, recovery codes and private keys out of your message.