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 Hosting
- Click on the hosting/domain name in question
- Under Sites, click on the domain name of the site to be configured
- Under PHP version on the left, click on Change
- Select the desired version and click on Save to save the changes
The change is effective immediately and is permanent.
Changing the PHP version used in a specific directory
It is possible to use different PHP versions on the same website.
For example, you can configure folder X with PHP 5.6, and folder Y with PHP 7.0. 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.
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 5.5: SetEnv PHP_VERSION 5.5
- for PHP 5.6: SetEnv PHP_VERSION 5.6
The change is effective immediately.