Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains how to change the PHP version available for the sites on your Web Hosting Infomaniak.
Preamble
- It is possible to switch from an old and potentially vulnerable PHP version to a recent one, but you will no longer be able to revert to this vulnerable version for security reasons.
- The change is effective immediately and permanently.
- Refer to this other guide if you are looking for information about configuring the PHP version used in SSH.
Change the PHP version used for a website
It is possible to easily modify the PHP version used for an entire website:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the relevant product.
- Click on β More information.
- Click on Modify:
- Select the desired PHP version:
- Click on Save at the bottom of the page to save the change.
It may be necessary to update your hosting in advance to access the very latest versions of PHP offered by Infomaniak.
This guide explains how to use PHP environment variables with Web Hosting that runs on php-fpm
.
Preamble
- PHP environment variables (
REDIRECT_
) are system variables used to store information about HTTP requests and redirects. - They are generally used on web servers to store details about previous requests or redirections that have been performed.
- The prefix "
REDIRECT_
" is often added to environment variables to indicate that they are related to specific redirections performed by the server. - These variables can contain information such as previous URLs, HTTP methods, or other data related to the client's navigation on the web server.
Using environment variables
To use PHP environment variables:
- Define the PHP environment variables in a
.htaccess
file:SetEnv EXAMPLEVARIABLE hello
- In your PHP file, the name of the variable to call must be prefixed with
REDIRECT_
:<?php getenv('REDIRECT_EXAMPLEVARIABLE');
In this example, the displayed result will be hello.
Going further with environment variables
It is possible to configure environment variables directly from the Manager for your entire website:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the concerned product:
- Click on Manage under Advanced settings:
- Click on the PHP / Apache tab.
- Click on the chevron β to expand the Environment Variables section.
- Click on the icon β Add.
- Enter the variable and its value.
- Click on the button to save:
This guide explains how to change the PHP version directly from the command line when you run PHP scripts using PHP CLI (Command Line Interface) on an Web Hosting Infomaniak.
Preamble
- This can be useful when you need to temporarily modify certain parameters for a specific script or for a PHP session.
- If you use only the mention
php
below, it is the release preceding the one already in place that will be installed (last version -1): if the last installed version is 8.1, it is 8.0 that will be used with "php
". It is preferable to use the mentionphp-7.0
,php-7.1
, etc. so that the version does not change over time with updates. - Refer to this other guide if you are looking for information about configuring the PHP version set on the Infomaniak Manager.
Change the PHP version used in CLI
It is possible to easily modify the PHP version used in the command line (CLI) via SSH:
- Log in to the server via SSH (need help?).
Create a
.profile
file if it does not exist:touch ~/.profile
Edit the
.profile
file:nano ~/.profile
Add this code inside the file to select the desired PHP version:
export PATH=/opt/php7.4/bin:$PATH
Load the
.profile
file:source ~/.profile
Check the PHP version:
php -v
Interactive mode
The .profile
file mentioned above is only loaded when the user interface is used. In SSH (login mode), it is the .bash_profile
file that is sourced. And in interactive mode (non-login), it is the .bashrc
file that is sourced.
Some server deployment scripts open sessions in interactive (non-login) mode and the environment variables are not loaded into the PATH even if the SSH session is correctly configured.
In this case, you need to load the php version in the .bashrc
file (export PATH="/opt/php7.4/bin:$PATH"
), and source the .bashrc
file in the .bash_profile
and .profile
files (. ~/.bashrc
).
After following these steps, the version of PHP you specified should be loaded into your shell environment every time you open a new session. This will allow you to run scripts using this version of PHP from the command line (CLI).
This guide relates to the execution of scripts launched via SSH on various types of machines.
No time limit
There is no predefined time limit for the execution of scripts launched via SSH, meaning that the script can run as long as necessary. However, if the SSH session ends, the script will also be interrupted.
It is possible to run scripts in the background to avoid this issue. In this case, the script will continue to run even if the SSH session is interrupted.
Other resources may be limited either by the machine's capacity or by the configuration (PHP scripts limited to 512 MB of memory, for example).
It is possible to change these limits on Serveur Cloud machines, but not on hΓ©bergements mutualisΓ©s.
This guide explains the differences between the web hosting offers to help you choose the best solution according to your computer needs.
If you are looking to host your email, refer to this other guide.
Web Hosting Starter
The free web hosting
The Starter Web hosting is offered for free with each domain name registered with Infomaniak. It provides 10 MB of disk space to create a site (basic pages in HTML language only - no PHP, no database) even without particular knowledge thanks to the Welcome Page tool.
- Register or transfer a domain name with Infomaniak
- Learn more about the benefits included with a domain name
Shared Web Hosting
The flagship offer to create your sites
These web hostings are shared offers (the websites will be hosted on servers whose resources are shared with other customers). To ensure the reliability of these shared services, Infomaniak servers use on average only 40% of the CPU power and are equipped with professional, latest generation SSD disks.
Web hosting offers a minimum of 250 GB of disk space and allows you to manage multiple websites with multiple domain names. This offer includes all the technologies usually used to create professional sites: PHP, MySQL, FTP and SSH access, SSL certificates and easy installation of WordPress or common CMS, etc. It is also possible to add a Node.js site and/or Site Creator.
Cloud Server
Professional Web hosting
With a Cloud Server, the resources allocated to you are not shared with other clients and you can customize the hardware and software configuration of your server according to your needs. A Cloud Server also allows you to use components that are not available on shared web hosting (Node.js
, mongoDB
, Sol
, FFMPEG
, etc.).
- A Cloud Server allows you to easily manage your server via the same administration interface as Web hosting - you manage the sites in the same way.
- A VPS allows you to manage your server completely autonomously with the version of Windows or the Linux distribution of your choice (
Debian
,Ubuntu
,openSUSE
, ...) - solid technical skills are required to use a VPS, including VPS Lite.
Public Cloud (and Kubernetes Service)
Open, proven, and secure IaaS solution
For Infomaniak, it is the infrastructure that drives kDrive, Swiss Backup and the Webmail, services used by several million users. But Public Cloud is accessible to everyone and provides the resources you need to develop your projects.β
With customized and tailored offers, you will have no trouble managing your development budget. No setup fees. No minimum amount. Cancelable at any time. You only pay for the resources actually used with Public Cloud at the end of each month, same for Kubernetes Service.
Jelastic Cloud
Web hosting tailored to your chosen technologies
Jelastic Cloud allows you to create custom development environments with the technologies of your choice (PHP
, Java
, Docker
, Ruby
, etc.). It is a flexible cloud offering:
- Horizontal and vertical scaling of resources.
- Payment based on actual resource consumption.
- Easy customization of your infrastructure (redundancy, IP, SSL, load balancing, etc.).
This guide explains how to customize the limits of a site hosted on a Web Hosting or a Cloud Server.
Unlock or adjust the limits of a site
To access website management:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the relevant product:
- Click on Manage under Advanced Settings:
- Click on the PHP / Apache tab.
You will be able toβ¦
- β¦ unlock for 60 minutes the memory limit (
memory_limit
= 1280 Mb) and the maximum script execution time (max_execution_time
= 60 minutes):- This unlock is possible up to 10 times a year.
- β¦ customize the limits of:
max_execution_time
(in seconds)memory_limit
(in MB)post_max_size
&upload_max_filesize
(maximum file size for upload, in Mo)- Cloud Server only:
Max children
(refer to this other guide) - Cloud Server only:
Max input time
Don't forget to save the changes at the bottom of the page.
Maximum values by hosting type
Limits | Shared | Cloud Server | CLI (Cloud Server only) |
---|---|---|---|
max_execution_time | 300 s | 3600 s | 0 (unlimited) s max |
memory limit | 1280 MB | 2048 MB max | 512 MB max |
post_max_size + upload_max_filesize | 9223372036854775807 Mo max | 9223372036854775807 Mo max | 48 MB max |
max_children | 20 max | 20 (default, modifiable) | |
simultaneous connections per IP | 30 max | 30 (default, modifiable) | |
maximum input time | 0 (unlimited) | 0 (default, modifiable) | 0 (unlimited) |
files (inodes) | no limit on the number of files per hosting |
This guide explains how to transfer to Infomaniak data (Web, Mail, Domain, and even Cloud) currently hosted elsewhere. You remain the obvious owner of your data, without loss or interruption!
Don't have time to migrate your services? Launch a free tender to find an Infomaniak partner who will take care of everything.
Specific guides
Click on the link corresponding to your current host:
- Swisscom: complete guide to migrate Web, Mail and domain name data
Guides for any other hoster
To retrieve any other data, follow the procedures below:
- Import Web data (all PHP, HTML, etc. sites.)
- For WordPress specifically, refer to this other guideβ¦
- For WordPress specifically, refer to this other guideβ¦
- Copy the Mail data (addresses and mailbox content, etc.) to kSuite or a simple Mail Service
- Transfer the domain name (domain management, DNS zone, etc.)
To avoid interrupting your website and emails and to avoid losing content while importing your existing data, migrate your services in the specified order.
You can also bring other types of data to the Infomaniak servers:
- Dropbox, Google Drive, etc. content: refer to this other guide
- Data on NAS Synology or QNAP: refer to this other guide
Why join Infomaniak?
By consolidating your domain names, websites, and email addresses with Infomaniak, you simplify the management of your invoices and services. Moreover, your domains will automatically link with your website and email address. You will therefore not need to manually configure the DNS of your domains with another registrar.
Learn more about Infomaniak
This guide details the security measures implemented for the Infomaniak email offers to detect abusive and abnormal use of an email address.
Preamble
- Upon written, justified and authenticated request, it is possible to modify these security rules for a specific paid email address.
- For sending emails to a large number of recipients, the Newsletter tool is the most suitable.
- These measures protect you from malicious use of your computer or your account.
Daily sending limits
The number of outgoing emails per 24 hours is limited to:
- my kSuite = 500ββ | my kSuite+ = 1440β
- kSuite Standard 1 max. user = 100β | kSuite Standard 2 min. users = 1440ββ | kSuite Pro = 1440ββ | kSuite Entreprise = 1440ββββ
- Service Mail Starter = 100β | Service Mail 5 addresses min. = 1440βββ
- Web Hosting (PHP Mail() function - unauthenticated sends) = 50β | Web Hosting (authenticated sends) = 1440ββ
1 message sent to 2, 42 or 99 people in CC/BCC counts as respectively 2, 42 and 99 messages.
Other email limits
This guide explains how to enable PHP-FPM status
to, for example, debug a slow site at the PHP level.
Preamble
PHP-FPM status
allows you to monitor in real-time the scripts that are executed as well as their execution time.- This operation is only possible on Serveur Cloud.
Enable PHP-FPM status
To activate PHP-FPM
on a site, contact Infomaniak support from an email address listed on your user account to authenticate your request.
In your request, please specify the source IP address that should be authorized.
Once PHP-FPM status
is activated, the following URL links will display the necessary information:
- https://domain.xyz/fpm-status?json&full
- https://domain.xyz/fpm-status?html&full
- https://domain.xyz/fpm-status?xml&full
Warning: if your site contains rewrite rules including the path /fpm-status
, you will likely need to make an exception for it.
This guide explains why it is dangerous to use a PHP version that is no longer officially maintained and how to use a more recent PHP version with a website hosted by Infomaniak.
Is an outdated version of PHP dangerous?
When you use a (soon to be) vulnerable version of PHP on one or more of your sites, a warning message appears in the dashboard of the affected hosting services.
The PHP language evolves regularly and when you use a PHP version that is no longer updated, you expose your website to security risks. Malicious individuals could, for example, exploit known security vulnerabilities to gain access to your site and alter its content. It is therefore strongly recommended to always use a recent version of PHP.
Three statuses are possible:
- The PHP version is fully supportedβ: no action is required
- The PHP version only receives security updatesβ: it is recommended to use a more recent version of PHP
- The PHP version is no longer updatedβ: it is strongly recommended to use a more recent version of PHP
Learn more: http://php.net/supported-versions.php
Using a more recent version
The latest versions of PHP are more performant and speed up website loading.
Before using a more recent version of PHP, it is necessary to take the following precautions:
- If your site runs on a CMS or a web application (WordPress, Joomla, Drupal, etc.), it is recommended to check that its current version is compatible with the PHP version you plan to use
- If your site was developed manually, it is necessary to consult the official PHP documentation to learn about modified functions and potential incompatibilities
If you encounter issues after migrating a site to a newer version of PHP, it may be possible to revert to a previous version of PHP if it is still supported.