Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Configuring/changing the PHP version used
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, click on the version to be configured for the entire website
- click on Save to save the changes
The change is effective immediately and permanently.
You must have a recent hosting offer (Cloud or shared) and not an old hosting format (60 GB) - change the offer if necessary).
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.
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 5.5: SetEnv PHP_VERSION 5.5
- for PHP 5.6: SetEnv PHP_VERSION 5.6
- etc.
The change is effective immediately.
To configure / change the version of PHP used in SSH follow this guide.
Link to this FAQ: