Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide helps resolve an error of type "Invalid query: MySQL server has gone away".
Preamble
- This type of error often originates from keeping a MySQL connection open without submitting requests for a period of time beyond which the connection is closed: http://dev.mysql.com/doc/refman/5.7/en/gone-away.html
- The variables
wait_timeoutandinteractive_timeoutthat control this disconnection are set to 30 seconds: http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html
Solutions
To avoid the "MySQL server has gone away" error, here are several possible approaches:
Verification and automatic reconnection
Before executing a query, it is recommended to test if the MySQL connection is still active. If the connection has been closed, you can automatically re-establish it before proceeding with your query. Here is an example in PHP:
if (!mysqli_ping($connexion)) {
mysqli_close($connexion);
$connexion = mysqli_connect($host, $user, $password, $database);
}The function mysqli_ping() checks if the connection is still valid. If it is not, the script closes the connection and opens a new one.
Regular "Ping" sending
Another method is to run a script that regularly sends a "ping" to the database to keep the connection active. For example, you could create a scheduled task (cron job) that sends a light query, such as SELECT 1; at regular intervals.
Adjusting MySQL parameters (Cloud Server)
With a Cloud Server, you can increase the values of the variables wait_timeout and interactive_timeout from the MySQL menu of your server to extend the duration of the connection before it is closed.
This guide explains how to create a PTR record on the dedicated IPs of VPS Cloud / VPS Lite.
Preamble
- A PTR (Pointer Record) is a type of DNS record used to resolve IP addresses into domain names.
- The PTR record is used to associate an IP address with a domain name or subdomain.
- It is the opposite of the A record which is used to resolve domain names into IP addresses.
Create a PTR on the VPS Cloud / VPS Lite IP
If you have a VPS Cloud / VPS Lite and you want to create a PTR record for your dedicated IP address, follow these steps:
- Make sure your domain or subdomain points to the IP address (v4 or v6) of your VPS Cloud / VPS Lite server.
- You can do this by creating an A record for your domain or by modifying the existing record to point to the IP address of your VPS Cloud / VPS Lite.
- Check that your domain points to the IP address of your VPS Cloud / VPS Lite (see 1).
- Contact Infomaniak support to request the creation of a PTR record for your dedicated IP address.
- Specify the IP address of your VPS Cloud / VPS Lite server (you can find this IP address in your server management dashboard or by using a command line command such as "
ifconfig" or "ipconfig" depending on the operating system you are using).
- Specify the IP address of your VPS Cloud / VPS Lite server (you can find this IP address in your server management dashboard or by using a command line command such as "
- Once the PTR record is created, use an online verification tool to ensure that the PTR record points to your domain or subdomain.
This guide is for you if you wish to perform vulnerability tests on your site/server hosted by Infomaniak.
Allowed and restricted
You are free to perform vulnerability tests (SQL injection, XSS, etc.), intrusion, or penetration testing (pentest) on your Infomaniak hosting only under the following conditions:
- ⊠between 9 AM and 5 PM CET
- ⊠from Monday to Friday
- ⊠with the minimum number of attack packets regardless of the software used (AppScan for example)
- ⊠without ever performing a single DoS or DDoS (Denial of Service) attack
- ⊠while respecting the Infomaniak Terms of Service, particularly the shared service framework
Any abusive use may result in early termination by Infomaniak.
This guide details the '502 Bad Gateway' errors that can be obtained by visiting a website.
Preamble
- The 502 Bad Gateway error occurs when the server acting as a gateway between the browser and the origin web server receives an invalid response.
- This error can be caused by an overloaded web server, communication issues between a CDN and the web hosting server, or a misconfigured proxy server.
- Sometimes, the error can be caused by a bad entry in the DNS server.
Resolution paths
To resolve the 502 Bad Gateway error, you often need to proceed by elimination:
- Check if it is not a temporary server overload: simply reload the page after a few minutes for the error to disappear.
- Clear the cache of the browser.
- Try from another browser.
This guide lists the Windows operating system versions that can be installed when ordering a VPS Cloud / VPS Lite.
Regarding Linux, please refer to this other guide.
Supported Windows versions
When ordering your Server, you will be able to choose the version of Windows to install.
Windows Server
Possible versions with Windows Server 2025, 2022 or 2019:
- Windows Server Standard designed for low-density or non-virtualized environments
- Windows Server Datacenter ideal for datacenter-defined and highly virtualized environments
Note:
- As a Microsoft partner, Infomaniak provides VPS Cloud / VPS Lite Windows Server 2025, 2022 or 2019 containing a Microsoft Windows Server license. In case of activation failure, refer to this other guide.
- As a Microsoft partner, Infomaniak does not offer the possibility to use your own Windows Server license (or Bring Your Own License).
- If you use Microsoft software within Windows Server that requires a License Mobility, such as Microsoft SQL Server, Microsoft Sharepoint Server or Microsoft Exchange Server, you must submit the Software Assurance document via the Infomaniak contact form.
Windows 11 Professional Evaluation
Windows 11 Professional has all the features of Windows 11 Home as well as professional features for encryption, remote connection, virtual machine creation and more.
The version 10 of Windows Professional Evaluation is also available.
Note:
- It will be necessary to activate Windows, Infomaniak provides only an evaluation version.
This guide explains how to connect to an external database from a Cloud Server.
Preamble
- It is possible to connect to MySQL (external or not) via SSL - to be specified when establishing the connection.
- The MySQL port
3306is closed by default - to open it, refer to this other guide. - Infomaniak does not install
PDO_DBLIB.
Install PHP_PDO_ODBC
Prerequisites
- Have the PHP Extensions menu on the Infomaniak Manager in the Cloud Server section (otherwise, it will be necessary to upgrade the Cloud Server).
It is possible to install the PHP_PDO_ODBC extension from the PHP Extensions menu of your Cloud Server:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product concerned.
- Click on PHP Extensions in the left sidebar.
- Click on the blue button Install an extension.
- Choose the
PHP_PDO_ODBCextension. - Confirm the installation.
Configure the connector
The driver configuration is already defined in /etc/odbcinst.ini:
[FreeTDS]
Description = MS SQL database access with Free TDS Driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.soThere is no need to redefine it statically in the .odbc.ini or in the user's home ~~/.odbc.ini~~ or also dynamically in the PHP code.
Example with the FreeTDS driver defined in advance, the version of the driver must also be specified at the end of the pdo object declaration:
$con = new PDO('odbc:Driver=FreeTDS;Server=__SERVER IP__;Port=3306;DATABASE=__DATABASE NAME__;UID=__USERNAME__;PWD=__PASSWORD__;TDS_Version=8.0');
This guide explains how to obtain information about the presence of a cache system on a site using the curl command.
Preamble
- In the world of programming and system administration, it is often necessary to determine if a website uses a caching system to improve its performance.
- Caching systems like Fastly are commonly used to temporarily store data to serve it faster to users.
- By following these steps, you will be able to determine if a website uses a caching system to improve its performance and understand the operation and optimization of websites.
Using the curl command
curl is a command-line tool for transferring data using URLs.
The option -svo /dev/null is used to perform a silent request (-s), display detailed information about the request (-v) and redirect the output data to /dev/null to ignore it (/dev/null is a special device on Unix/Linux systems that acts like a trash can). -H "Fastly-Debug: true" is an HTTP header added to the request to request Fastly-specific debugging information.
Run the command
Run the following command from a Terminal type application (command-line interface, CLI / Command Line Interface) on your device:
curl -svo /dev/null [url] -H âFastly-Debug: trueâand replace [url] with the address of the website you want to check.
If the site uses Fastly or another similar caching system, you will see specific debugging information in the command output. The details provided may include information about HTTP requests and responses, as well as information about the cache and performance.
This guide concerns ImageMagick, a powerful solution for image manipulation, which you can install on an Infomaniak Web Hosting.
For installation, the easiest way is to use Fast Installer.
ImageMagick and alternatives
These image manipulation solutions are compatible with Web Hosting and Cloud Servers:
ImageMagick: the main software suite for versatile image manipulation via the command linePerlMagick: Perl interface to integrate ImageMagick functionalities into Perl scripts- Perl Module
Image::Magick: Perl extension to access ImageMagick functionalities without specifying the absolute path of the executable GD 2.x: open-source graphics library offering functionalities similar to ImageMagick, often used in web development contextsGallery 2: image gallery management platform compatible with ImageMagick for online presentation
If necessary, the path for ImageMagick is standard since it is installed through the Debian repository:
/usr/binand for the Perl module Image::Magick:
/usr/local/bin/convertor without specifying the absolute path:
$ perl -e 'use Image::Magick';All imagemagick commands are under /usr/bin/:
/usr/bin/animate
/usr/bin/compare
/usr/bin/composite
/usr/bin/conjure
/usr/bin/convert
/usr/bin/display
/usr/bin/identify
/usr/bin/import
/usr/bin/mogrify
/usr/bin/montage
/usr/bin/streamThis guide details the use of Crontab (crons via SSH), available only on Cloud Server, by default (there is also a task scheduler for all hosting).
Prerequisites
- The script files called by the cron must be executable (CHMOD).
Full path
Cron tasks do not know the absolute path (path). Calling PHP without specifying the full paths to the executable makes it impossible to execute the task. You must specify
/opt/phpX.X/bin/phpby replacing X.X with the desired PHP version (/opt/php7.1/bin/php for example).
Other operations
List the crons of the SSH user in question:
crontab -l -u NomUtilisateurSSHEdit the crons:
crontab -e -u NomUtilisateurSSHBe notified by email of the result of your cron tasks (to be added at the beginning of the file):
MAILTO=e-mail@domain.xyz
Restore a backup
Infomaniak backs up the crons of the last 7 days (once a day). In case of accidental deletion, contact Infomaniak support to request a restoration specifying the time and date of the deletion.
This guide explains how to view file activity on your Infomaniak hosting server.
FTP space activity logs
To know the activity of exchanges on your FTP space, contact Infomaniak support to request FTP logs by first authenticating with the credentials corresponding to the management of your web hosting.
The log is only updated if there has been FTP activity.
Help reading logs: http://www.castaglia.org/proftpd/doc/xferlog.html
The user and the process "cloud base - ini" are used as part of the VPS Cloud / VPS Lite infrastructure of Infomaniak (in the case, for example, where the instance is rebuilt). Learn more
This guide explains how to modify your current Managed Cloud Server offer.
Modifying resources and configuration
The basic Managed Cloud Server plan includes 5 hostings and 20 websites. To add an additional hosting or modify the server configuration to increase CPU / RAM:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click on the action menu âź located to the right of the item concerned.
- Click on Modify the offer:

- Make the desired adjustments and complete the procedure.
To reduce the size of the entire Managed Cloud Server disk space:
- Order a new server with the desired new storage (contact support to order the new server for free while performing the steps below).
- Move the hostings from the old server to the new one.
- Cancel the old server.
Refer to this other guide to modify the disk space of a hosting.
Increasing the process limit
On Linux, the number of processes that a user or a system can create simultaneously is limited. These limits prevent processes that are too fast from consuming excessive resources and affecting the overall stability of the system. Process limits are managed by the Linux kernel and can be viewed and modified using specific commands and configuration files. You can request to increase the limits by contacting support.
This guide helps you find the public IP address of your device, which can be useful for certain support requests, among other things.
Display the public IP address on the connected device
Click here to obtain the public IP address of your device in IPv4 and IPv6 format.
Alternative methods
Visit ipinfo.io or ifconfig.me.
... on macOS
- From a terminal application (command line interface, CLI) on your device, run the command
curl ifconfig.meand press enter. - The displayed address is the public IP address of the computer.
Do not forget that this address can change periodically, especially if the router restarts or if the internet service provider uses dynamic IP address allocation.
To automate the search for the public IP address, use commands or scripts that query services such as api.ipify.org ...
This guide explains how to use GnuPG / PGP with PHP on a Cloud Server using a "pure PHP" alternative, following the obsolescence of the native extension.
Preamble
- The system extension
PHP_GnuPGis no longer maintained by the PHP community, so it is no longer available on recent environments. - There are two main "pure PHP" alternatives (installable via Composer) to continue signing or encrypting your data securely.
Option 1: Crypt_GPG (recommended)
This library is a "wrapper": it uses the gpg binary already installed on your Cloud Server. It is the most robust solution and the closest to the old extension.
To install the library in your project, connect via SSH and run the following command at the root of your site:
composer require pear/crypt_gpgHere is how to use the library to encrypt a message. Unlike the old extension, the approach here is object-oriented:
<?php
require_once 'vendor/autoload.php';
try {
// Initialisation de l'objet GPG
$gpg = new Crypt_GPG();
// Spécifiez l'email correspondant à la clé publique importée sur le serveur
$gpg->addEncryptKey('contact@exemple.com');
$message = "Ceci est un message secret.";
$enveloppe = $gpg->encrypt($message);
echo $enveloppe;
} catch (Exception $e) {
echo "Erreur : " . $e->getMessage();
}Option 2: OpenPGP.php (independent)
This library is entirely written in PHP. It does not depend on the gpg software installed on the server, which ensures total portability of your code. Installation:
composer require singpolyma/openpgp-phpUsage example:
<?php
require_once 'vendor/autoload.php';
// La logique ici utilise directement les classes de la bibliothĂšque
// pour manipuler les paquets OpenPGP sans appel systĂšme.â ïž For additional help contact a partner or launch a free call for tenders â also discover the role of the host.
This guide explains how to use PHP environment variables with Web Hosting that runs on php-fpm.
Preamble
- PHP environment variables 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 redirects that have been performed.
- 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
.htaccessfile:SetEnv EXAMPLEVARIABLE hello
- In your PHP file, the name of the variable to call corresponds to the same variable name defined in the environment variable:
<?php getenv('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 product concerned:
- 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 the button to save:

This guide helps resolve issues with special characters (accents, emojis, etc.) that do not display correctly or appear as symbols like ??, often due to incorrect encoding when connecting to MySQL.
Preamble
- By default, MySQL uses
UTF-8. - Recent MySQL servers are generally configured to use
UTF-8orUTF-8MB4by default.- This is suitable for most cases, especially for international languages and emojis.
- Also, refer to this other guide to learn how to avoid encoding issues with non-European characters and emojis in your developments.
Set the default MySQL / MariaDB charset (Cloud Server)
With an Infomaniak Cloud Server, you can set the default charset (utf8 or utf8mb4):
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product concerned.
- Click on MariaDB in the left sidebar.
- Choose the default charset:

- If you have not yet migrated to MariaDB, the principle is the same.
- Save your changes at the bottom of the page.
Force a specific encoding (latin1 for example)
If you need to work with a database in latin1 (ISO-8859-1), you must explicitly align the encoding when connecting, depending on your environment.
On current offers, place the following code in a user.ini file located at the root of your hosting:
mysql.connect_charset = "latin1"
mysqli.connect_charset = "latin1"
pdo_mysql.connect_charset = "latin1"or in PHP (MySQL API):
mysql_query("SET CHARACTER SET latin1");On older hosting plans, force the MySQL connection to latin1 via the .htaccess file located at the root of your hosting:
php_value mysql.connect_charset latin1
php_value mysqli.connect_charset latin1
php_value pdo_mysql.connect_charset latin1
This guide explains how to back up a Cloud VPS in the form of a snapshot.
Preamble
- A snapshot is like a photo of your Cloud VPS at a given moment, containing everything on your server, including your operating system, your applications, your data, etc.
- Snapshots can be used, among other things, forâŠ
- ⊠protect your Cloud VPS in case of a problem: if you encounter a problem with your Cloud VPS, you can restore a snapshot to return to a previous state.
- ⊠test modifications without risk: before making significant changes to your Cloud VPS, you can create a snapshot to be able to revert if necessary.
- You benefit from a free snapshot to back up your entire server in a dedicated space. If necessary, it is possible to order additional spaces or delete a snapshot to create a new one.
- Two types of backups are possible:
- Snapshot of data: allows you to create an image of the volume containing your data (not available for Windows distributions).
- Snapshot of the operating system: allows you to create an image of the volume containing your operating system. This type of backup involves a brief interruption of your applications and websites.
- It is recommended to create snapshots regularly, e.g., once a week or month; this will allow you to have a history of your Cloud VPS and to be able to revert in case of a problem.
- It is obviously possible to restore the state of the Cloud VPS thanks to the previously created snapshot.
Create a snapshot
To do this:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Snapshot in the left sidebar.
- Click the blue button Create a snapshot:

- Choose the type of snapshot to create (data or operating system).
- Click the blue button to start creating the snapshot:

- An email is sent when the snapshot is generated.
Delete a snapshot
To do this:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Snapshot in the left sidebar.
- Click on the action menu âź to the right of the object concerned in the table that appears.
- Click on Delete:

Order additional snapshots
To do this:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Snapshot in the left sidebar.
- Click on the shopping cart icon:

- Follow the instructions to complete the order.
It is not possible to order an additional snapshot if a snapshot is in progress.
This guide explains how to find out the operating system version of the server for your Web Hosting.
Preamble
- Even if Debian or a package seems outdated, the displayed versions do not present any vulnerabilities:
- Infomaniak keeps them up to date via regular internal patches on all components and systems used.
- The versions are chosen for their stability and then strengthened by security measures that standard tests do not detect.
- If you or your clients identify a vulnerability in an Infomaniak product, please submit a POC. Although rare, these cases are handled quickly.
- Data security is the responsibility of the user: Infomaniak cannot be held responsible for poor management or use of access credentials.
What OS on my site?
To find out the version:
- Log in to the server via SSH (need help?).
Run the following command:
lsb_release -aYou will obtain information of this type:
Distributor ID: Debian Description: Debian GNU/Linux 7.9 (wheezy) Release: 7.9 Codename: wheezy
Supervisor is not offered directly because systemd is recommended, better integrated with Debian, and available in Fast installer.
If you still need to install it, contact Infomaniak support in writing.
This guide explains how to increase the storage volume of your Cloud VPS once the offer change has been made.
Preamble
- By default, the Cloud VPS is provided with two volumes:
- 1 volume for the operating system of your choice (
/dev/vda). - 1 volume for storing your data (
/dev/vdb), this is the one that will be increased.
- 1 volume for the operating system of your choice (
- Warning: depending on the installed operating system, the system volume may be named
/dev/sda,/dev/sda1or/dev/vda; the same applies to the data volume/dev/sdb,/dev/sdb2or/dev/vdb... It is therefore necessary to replace these indications with those corresponding to your situation.
SSH commands to increase the storage volume
If you choose XFS, for example, it is necessary to install the appropriate tools (if they are not already present):
sudo apt install xfsprogsThen increase the volume with the following SSH commands:
sudo xfs_grow /dev/vdbAnd if you choose EXT4:
sudo resize2fs /dev/vdbExtend the volume after increasing the storage volume
Two scenarios may arise once you have extended the storage volume of your Linux server. Note that no data is deleted when increasing the space via the offer change of your VPS.
First scenario
In the case where the entire volume is used without partitioning, it is not necessary to do a resizepart, since there is no partition.
sudo umount /dev/vdb
sudo fsck.ext4 -f /dev/vdb
sudo resize2fs /dev/vdbSecond scenario
In the case of a volume that contains a partition (/dev/vdb1), you must first stop the processes that use this volume, then you must unmount the partition.
sudo umount /dev/vdb1You then need to increase the partition size with parted, which has the resizepart command, unlike fdisk.
sudo parted /dev/vdb
GNU Parted 3.2
Using /dev/vdb
Welcome to GNU Parted! Type âhelpâ to view a list of commands.
(parted) resizepart 1 100%
(parted) quit
sudo fsck.ext4 -f /dev/vdb1
sudo resize2fs /dev/vdb1And the System volume?
It is not possible to increase the size of the system volume.
For Linux, Infomaniak provides 20 GB, sufficient for any Linux distribution.
For Windows, Infomaniak provides 100 GB on the C drive, sufficient for Windows. Applications must be installed on the D drive. If you have 50 GB, you can request 100 GB (contact Infomaniak support specifying a time slot for the operation as there are a few minutes of downtime to expect).