1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Configuring/changing the PHP version used
This guide explains how to change the PHP version available for your site.
Changing the PHP version used on a website
You can easily change the PHP version used throughout a website:
- Open the Manager (manager.infomaniak.com)
- Go to Web hosting
- If necessary, click the hosting/domain name in question
- Under Sites, click the domain name of the site to be configured
- Under PHP version on the left, click Change
- Select the desired version and click Save to save the changes
The change is effective immediately and is permanent.
Obsolete method: SetEnv with .htaccess
An obsolete method and one that will soon be forbidden: use different PHP versions on the same website using a .htaccess file.
For example, you can configure folder X with PHP 7.1, and folder Y with PHP 7.4. If necessary, you can even switch from one version of PHP to another without interrupting your website.
The PHP version used by default is PHP 7. It is essential that you only specify PHP versions which are offered in your manager.infomaniak.com.
To configure a folder and its subfolders with another version of PHP:
- if necessary, create a .htaccess file in the folder to be configured (help)
- insert this code in the .htaccess file and save your changes:
- For PHP 7.1: SetEnv PHP_VERSION 7.1
- for PHP 7.2: SetEnv PHP_VERSION 7.2