Dieser Artikel richtet sich an Kunden mit einem cPanel Hosting Produkt.
Sie haben die Möglichkeit in Ihrem MyH die PHP Version zu ändern.
Dies können Sie in unter Einstellungen und dem Reiter "Server" ändern.
Damit wird diese für das komplette cPanel Hosting übernommen.
PHP-Version für einzelne Verzeichnisse separat ändern:
Die PHP Version lässt sich über den oben erläuterten Menüpunkt "PHP-Version wählen" nicht für einzelne Verzeichnisse ändern. Dies ist jedoch mit einer .htaccess Datei in dem jeweiligen Verzeichnis der Domain möglich. Erstellen Sie bitte eine Textdatei mit dem Namen .htaccess mit folgendem Inhalt und laden diese dann per FTP in das Verzeichnis der Domain bzw. in der gewünschte Unterverzeichnis.
PHP 7.3
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php73___lsphp
</FilesMatch>
PHP 7.4
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php74___lsphp
</FilesMatch>
PHP 8.0
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php80___lsphp
</FilesMatch>
PHP 8.1
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php81___lsphp
</FilesMatch>
PHP 8.2
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php82___lsphp
</FilesMatch>
PHP 8.3
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php83___lsphp
</FilesMatch>
PHP 8.4
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php84___lsphp
</FilesMatch>
Diese Einstellung gilt dann automatisch für alle Unterverzeichnisse, solange nicht eine neue .htaccess mit einem anderen Wert gesetzt wird.
Sie können alle PHP-Versionen auswählen, die auch im cPanel angezeigt werden.
English Version:
This article is aimed at customers with a cPanel hosting product.
You have the option of changing the PHP version in your MyH.
You can change this under Settings and the “Server” tab.
This will be applied for the entire cPanel hosting.
Change PHP version for individual directories separately:
The PHP version cannot be changed for individual directories via the menu item "Select PHP version" as described above. However, this is possible with a .htaccess file in the respective directory. Please create a textfile with the filename .htaccess and one of the following contents. Please upload the file in the directory of your domain or in the desired subdirectory.
PHP 7.3
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php73___lsphp
</FilesMatch>
PHP 7.4
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php74___lsphp
</FilesMatch>
PHP 8.0
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php80___lsphp
</FilesMatch>
PHP 8.1
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php81___lsphp
</FilesMatch>
PHP 8.2
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php82___lsphp
</FilesMatch>
PHP 8.3
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php83___lsphp
</FilesMatch>
PHP 8.4
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php84___lsphp
</FilesMatch>
This setting then automatically applies to all subdirectories, as long as a new .htaccess with a different value is not set.
You can select all PHP versions that are also displayed in the cPanel.