How to change PHP version

PHP version can be changed in the main menu of the control panel. Please note that in some control panels the PHP version can be changed not for a specific domain, but for the whole hosting service with all of its domains.

DirectAdmin

  1. Go to your client area to the “Services – My Services” section and click the “Open Direct Admin” button;
  2. The Direct Admin panel will be opened. Go to the “Extra Features” section and click the “Select PHP Version” button;
  3. Select the needed version from the “PHP Version” drop-down list and click the “Save as current” button;
  4. Once the “Current PHP version” row is updated, you can configure your PHP module list. Just hit the checkbox near the needed module names and click the “Save” button. To get back to the standard module list, click the “Use Defaults” button;
  5. The “Show PHP Settings” button allows you to configure some PHP directives. Here you can change the value of such basic parameters as max_execution_time, memory_limit, upload_max_filesize, and others;
  6. To change the directive value, click its current value, type the needed value, and click “Save”. Done.

It is enough to add the following lines to the .htaccess file to change the PHP version of each website separately:

For php 5X:

<IfModule mime_module>
AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>

For php 7X:

<IfModule mime_module>
AddType application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>

cPanel

  1. Go to your client area to the “Services – My Services” section and click the “Open cPanel” button;
  2. The cPanel will be opened. Go to the “Software” section and click the “Select PHP Version” button;
  3. Select the needed version from the “Current PHP version” drop-down list and click the “Set as current” button;
  4. Once the “Current PHP version” row is updated, you can configure your PHP module list. Just hit the checkbox near the needed module names. To get back to the standard module list, click the “Reset to default” button;
  5. The “Options” tab allows you to change some of the PHP directives. Here you can change the values of such basic parameters as max_execution_time, memory_limit, upload_max_filesize, and others. To change the value of a directive, click on its current value and specify the required.

Also, you can change the PHP version separately for each site/subdomain in the “Software – MultiPHP Manager” section. In the “PHP version” drop-down list, select the required version, check the domains/subdomains for which you want to install the selected PHP version, and click on the “Apply” button.

ISPmanager

  1. Go to your client area to the “Services – My Services” section and click the “Open ISPmanager” button;
  2. The ISPmanager panel will be opened. You can change the PHP version for a separate domain by going to the section “WWW – WWW-domains – Edit”;
  3. In the “Additional features” section, in the “PHP LSAPI version” drop-down list, select the required version and click the button “Ok”;
  4. Configuring the list of PHP extensions is available in the section “WWW – PHP – CGI and LSAPI extensions”. To activate a module, select the required module from the list and click on the “Enable” button;
  5. Changing PHP directives is available in the “WWW – PHP – Settings” section. To change the value of a directive, click on its current value and specify the required and click the button “Ok”.
Rate this article
Share this article
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
In this article