DocumentationWhat payment methods does Hostednode accept?What are Hostednode's billing cycles?When is the monthly renewal charge generated?When are services suspended for non-payment?When is a service deleted for non-payment?What should you do if a payment method is unavailable?Are all services subject to VAT?Do you issue receipts or invoices?How to create a customer account on HostednodeDo you accept cryptocurrency payments?How to Access DirectAdmin and Explore the Panel’s Main FeaturesHow to Configure PHP for Subdomains and Additional Domains in DirectAdminHow to change the PHP version and settings in DirectAdminHow to Create an Email Account in DirectAdminHow to use ClamAV antivirus from DirectAdmin
TUTORIAL

How to change the PHP version and settings in DirectAdmin

Change the PHP version and adjust memory_limit, post_max_size, max_execution_time, and upload_max_filesize from PHP Settings in DirectAdmin.

Use PHP Settings in DirectAdmin to choose your site's PHP version and adjust memory_limit, post_max_size, max_execution_time and upload_max_filesize from the panel.

What the version changes and what the parameters change

The PHP version determines which version of the interpreter runs your site's code. Choose one that is compatible with your application and its plugins. The PHP parameters set memory, size, and execution time limits; their values must match your application's requirements and what your service allows.

Before you begin

  • Log in to DirectAdmin using your hosting details and select the domain you want to manage.

  • Check which version and values your application needs.

  • Note the current version and parameters so you can restore those values if you need to undo a change.

  • Before changing the version on a live site, have an up-to-date backup of its files and database available.

1. Open PHP Settings

On the DirectAdmin dashboard, find Account Manager and click PHP Settings.

DirectAdmin dashboard with the Account Manager group and the PHP Settings tool.
PHP Settings is located under Account Manager.

At the top, you will find the PHP Version selector. Below it are the custom parameters table, if any exist, and the Add New Custom Value form.

PHP Settings section with the version selector and the Add New Custom Value form.
PHP Settings view for the selected domain.

2. Change the PHP version

  1. Open the PHP Version selector.

  2. Select the version compatible with your application.

  3. Click Update Version below the selector.

  4. Wait for the confirmation PHP versions saved and reopen the section to check the selection.

  5. Open the site and check that its pages, forms, and usual features still work.

PHP version selector expanded to show the available versions.
Choose a version compatible with your application.

The list shows the versions available with your service. If the version you need is not listed, ask support about its availability.

3. Identify the parameter you need to adjust

Parameter

What it controls

Example value

memory_limit

Maximum memory a PHP script can use.

256M

post_max_size

Maximum total size of a POST request, including files and other form fields.

128M

max_execution_time

Maximum execution time of a PHP script, expressed in seconds.

120

upload_max_filesize

Maximum size of each file uploaded through PHP.

64M

The values in the table are examples. Use the values your application needs and your hosting allows. Sizes are expressed in the units offered by the panel, such as M or G; max_execution_time is entered as a number of seconds.

To allow an upload, post_max_size must be greater than upload_max_filesize, with room for the other form data. For example, you can use 128M for POST for a maximum of 64M per file.

4. Add a custom value

  1. Under Add New Custom Value → Setting, select the parameter. Scroll within the list if necessary.

  2. Under Value, choose or enter the value required by your application. For example, select 256M for memory_limit.

  3. Click Add and wait for the confirmation Custom php.ini value added.

  4. Check that the parameter appears in the table.

  5. Repeat the procedure for the other parameters you need to adjust.

Setting list expanded to select a PHP parameter.
Scroll through Setting until you find the parameter you need.
Form with memory_limit selected and a value of 256M.
Example: adding memory_limit with a value of 256M.

Add saves each new parameter. If the parameter is already listed in the table, edit its value in that row and click Save below the table.

PHP parameters table with max_execution_time, memory_limit, post_max_size, and upload_max_filesize.
Custom parameters for the domain and the Save button for editing their values.

5. Check the changes

  1. Reopen PHP Settings and check that the saved version and values are the ones you chose.

  2. If you changed parameters, wait up to 3 minutes for them to apply.

  3. On the site, test the operation you needed the adjustment for, such as a file upload or a form.

Modify or remove a customization

To modify an existing parameter, change the value in its row and click Save. To remove a customization, click Delete in the corresponding row and check the panel's confirmation. Once it is removed, the site uses the value determined by the service configuration.

If you need to return to a previous PHP version, select it and click Update Version. To undo a parameter edit, enter the value you noted before the change and save.

If a notice or error appears

Situation

What to do

The panel indicates that only the default domain can control the settings

Open the tool from that domain and confirm the scope of the adjustment before saving. Do not assume that the values will apply independently to each site.

The value is rejected

Check the options and limits shown in the form and use a value allowed by the service.

The site's behavior does not change immediately

Wait up to 3 minutes after saving. Then check the site again and review the error message if the problem persists.

The site displays errors after changing the version

Revert to the previous version and review the compatibility requirements for the application and its plugins.