Mit dem PHP Selector im Cpanel können Sie einfach die gewünschte PHP Version für Ihren Hosting Account wählen. Falls Sie aber unterschiedliche PHP Versionen in Ihrem Hosting Account benötigen, dann gibt es die Möglichkeit mit einem Eintrag in der .htaccess Datei die PHP Version für dieses Verzeichnis und alle Unterverzeichnise zu überschreiben. Erstellen Sie dazu im gewünschten Verzeichnis eine Datei mit dem Namen .htaccess und folgendem Inhalt:
Für PHP 7.1:
AddType application/x-httpd-ea-php71 .php
Für PHP 7.0:
AddType application/x-httpd-ea-php70 .php
Für PHP 5.6:
AddType application/x-httpd-ea-php56 .php
Für PHP 5.5:
AddType application/x-httpd-ea-php55 .php
Für PHP 5.4:
AddType application/x-httpd-ea-php54 .php
Für PHP 5.3:
AddType application/x-httpd-ea-php53 .php
Für PHP 5.2:
AddType application/x-httpd-ea-php52 .php
Falls Sie möchten, dass PHP Code nicht nur in Dateien mit der Endung .php ausgeführt wird, so können Sie den Eintrag mit der gewünschten Dateiendung ergänzen. In folgendem Beispiel werden .htm Dateien zusätzlich mit PHP 7.1 ausgeführt:
AddType application/x-httpd-ea-php71 .php .htm
Kommentare