Within DirectAdmin, you can select the PHP version for your hosting environment and control which PHP modules are enabled or disabled. Before changing your PHP version, ensure that your website or application supports the version you intend to use.
The PHP selector in DirectAdmin makes this very easy. It allows you to switch between PHP versions to, for example, test whether specific parts of your website function correctly with a particular version or not.
Changing the PHP version
1. Log in to DirectAdmin.
2. In the menu, go to 'Extra Features' → 'Select PHP version'.
3. Select the desired PHP version from the drop-down menu under 'Current PHP version'.
4. Click 'Apply' to implement the change.
5. You have now successfully changed the PHP version. You can always switch back to a different version the same way.
If you change the PHP version this way through DirectAdmin, the new version will apply to all websites on your plan. If you want to change the PHP version for a specific website only, you can do so via the .htaccess file.
Activate/deactivate PHP modules
You can activate various PHP modules. You can do this by ticking the checkbox next to the modules you want to activate, for example, 'imagick'.
If you want to revert to the default settings, click on 'Reset to default' at the top right.
Modules need to be activated individually for each PHP version. If you switch to a different PHP version, any modules you previously enabled will need to be reactivated.
Change PHP memory_limit
The value for memory_limit indicates the maximum amount of memory each individual PHP script is allowed to use on your hosting plan. By default, this value is set to 128M, but you can adjust it as needed using the PHP selector.
1. On the PHP selector page, click 'Options' at the top.
2. Click on the value behind 'memory_limit' and select the desired new limit.
3. The change will be saved automatically after selection. To return to the default values, click 'Reset to default'.
Change upload_max_filesize
The upload_max_filesize value specifies the maximum size of files that can be uploaded via a PHP script. Sometimes, this value may be overridden for uploads through a PHP script. By default, it is set to 32M, but it can be increased using the PHP selector.
1. On the PHP selector page, click 'Options' at the top.
2. Click on the value behind 'upload_max_filesize' and select the desired new limit.
3. The change will be saved automatically after selection. To return to the default values, click 'Reset to default'.
Change max_execution_time
The max_execution_time determines the maximum number of seconds a script is allowed to run before it is terminated. This helps prevent, for example, a poorly written script from consuming resources for an unnecessarily long time. By default, this value is set to 30, but it can be adjusted.
1. On the PHP selector page, click 'Options' at the top.
2. Click on the value behind 'max_execution_time' and select the desired new limit.
3. The change will be saved automatically after selection. To return to the default values, click 'Reset to default'.
Change max_input_vars
The value for max_input_vars determines the maximum number of input variables that are accepted. Limiting this helps reduce the risk of a certain type of DDoS attack. By default, this value is set to 1000, but it can be adjusted. For example, some WordPress themes may require a higher value.
1. On the PHP selector page, click 'Options' at the top.
2. Click on the value behind 'max_input_vars' and select the desired new limit.
3. The change will be saved automatically after selection. To return to the default values, click 'Reset to default'.