Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

This guide helps resolve an error of type "Invalid query: MySQL server has gone away".

 

Preamble

 

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.


Has this FAQ been helpful?

This guide covers "browscap.ini", a legacy configuration file used by PHP to identify web browser characteristics (name, version, capabilities, OS) from their User-Agent string.

The use of browscap.ini is now considered obsolete for new projects due to its negative impact on performance and the evolution of web standards.

 

Information about the file and legacy usage

For the native PHP function get_browser() to work, it must point to an up-to-date browscap.ini file. The default path on servers is usually:

/opt/php/lib/php/browscap.ini

Although not recommended for production due to the file size (several MB to load into memory), you can view its content via this script:

<?php
header("Content-type: text/plain");
if (file_exists("/opt/php/lib/php/browscap.ini")) {
    echo file_get_contents("/opt/php/lib/php/browscap.ini");
} else {
    echo "Fichier introuvable.";
}
?>

 

Recommended modern alternatives

For current projects, developers prefer the following solutions:

  1. Libraries via Composer: tools like matomo/device-detector or whichbrowser/parser are more accurate, faster, and easily updated via project dependencies.
  2. User-Agent Client Hints (UA-CH): the new HTTP standard for obtaining structured and reliable information directly from the browser.
  3. Feature Detection: use JavaScript (or @supports queries in CSS) to check if a feature exists, rather than guessing the browser name.

Has this FAQ been helpful?

This guide concerns Django, an open-source web development framework in Python.

 

Installing Django

It is possible to install Django on web offers such as VPS Cloud / VPS Lite: discover the different web hostings from Infomaniak.


Has this FAQ been helpful?

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

  1. From a Terminal type application (command-line interface, CLI / Command Line Interface) on your device, run the command curl ifconfig.me and press enter.
  2. The displayed address is the public IP address of the computer.

 

Remember that this address may change periodically, especially if the router restarts or if the internet service provider uses dynamic IP address assignment.

 

To automate the search for the public IP address, use commands or scripts that query services such as api.ipify.org ...


Has this FAQ been helpful?

This guide explains how to use PHPMailer with Infomaniak Web Hosting.

 

Preamble

  • PHPMailer is a library that allows you to send HTML-formatted emails from a website.
  • This library, in particular, supports attachments and SMTP authentication, as well as multipart/alternative for clients that cannot read HTML-formatted emails.

 

Using PHPMailer

To use PHPMailer, you need to install it manually:

  1. Click here to download the PHPMailer library.
  2. Copy the files to a directory on your website via FTP.
  3. Link your script to PHPMailer, example (replace xxxx with the path to the tool):

    require_once('xxxx/class.phpmailer.php');

 

Resolve a Sender mismatch error

In the SMTP (Simple Mail Transfer Protocol) protocol, the From header specifies the email address of the sender of the message. This is the address that will appear in the ‘From’ field of the message received by the recipient.

In PHPMailer, the setFrom method is used to set the sender's email address, while the From header is used to specify this same address when sending the message. The setFrom method also sets the Reply-To field of the email.

The error Sender mismatch SMTP code: 550 Additional SMTP info: 5.7.1 occurs when the email address specified in the setFrom field does not match the email address specified in the From header when sending the message.

To avoid this error:

  1. Instead of using the setFrom method to set the sender's email address, use the From property of the PHPMailer object, example:

    $mail = new PHPMailer();
    $mail->From = 'sender@domain.xyz';
  2. Make sure the value specified in the From property matches exactly the email address used in the setFrom field.

    Example, if you use setFrom with a sender's name like this:

    $mail->setFrom('sender@domain.xyz', 'From Name');

    … then make sure that the value of From is also set with the sender's name:

    $mail->From = 'sender@domain.xyz';
    $mail->FromName = 'From Name';

Then, continue the configuration and sending of the email as usual.

 

Learn more


Has this FAQ been helpful?

This guide explains how to enable the MultiViews option via a .htaccess file on sites hosted by Infomaniak.

 

Preamble

  • In some cases, the MultiViews option must be enabled to manage redirection and URL rewriting issues.
  • This option allows the server to guess which file the user is looking for. Example:
    • If the configuration folder and the configuration.php file are located at the root of your site and you try to access the address domain.xyz/configuration, the MultiViews option must be enabled for the server to guess that you want to access the configuration.php file.
  • The MultiViews option can sometimes conflict with more complex URL rewriting rules defined by mod_rewrite (used by many CMS).

 

Enable the MultiViews option

To do this:

  1. Open or create the .htaccess file located at the root of the affected site.
  2. Add the following directive:

    Options +MultiViews
  3. Save the changes.

Has this FAQ been helpful?

This guide covers the execution of the C# language and the .NET framework via the Mono implementation on Infomaniak hosting.

 

Technologies for software development

To use the C# language and the .NET framework with the Mono implementation, in order to develop software applications that can be deployed and executed on multiple platforms, outside the Windows environment, it is recommended to opt for solutions such as:

The flexibility and portability offered by these multi-platform environments mean that a shared web hosting does not allow the execution of projects based on C#, .NET or Mono.


Has this FAQ been helpful?

This guide explains how to modify an existing Web Hosting offer to, for example, host additional websites if the maximum site quota is reached, or to obtain a more recent hosting solution to benefit from the latest versions of PHP & MySQL.

 

Modify the web hosting offer to…

 

… order additional sites, disk space, or IPs

To access the web hosting configurator:

  1. Click here to access your hosting management on the Infomaniak Manager (need help?).
  2. Click on the action menu ⋮ located to the right of the hosting concerned.
  3. Click on Modify the offer:
  4. Increase the values you wish to modify.
  5. Click on the Next button to proceed to the payment of the modifications made to the hosting:

 

… switch to a more recent server

To obtain a hosting solution on a more recent server and thus benefit from, among other things, the latest versions of PHP & MySQL, you can either…

  • … refer to this other guide by following the procedure indicated to the end:
  • … refer to this other guide by following the procedure indicated up to point 4 then click on the button to update:

If no information banner is displayed, it means you already benefit from a recent hosting offer.


Has this FAQ been helpful?

This guide details the integration of the ASP / ASP.NET environment within the Infomaniak ecosystem.

 

Compatibility & Infrastructure

Web Hosting and Managed Cloud Server solutions are optimized for Linux/Apache environments. Therefore, the Apache::ASP module is not natively supported on these shared offers.

 

Alternatives & Cloud solutions

To deploy your ASP applications smoothly, several options are available to you:

  • VPS Cloud: install and configure your own ASP/IIS stack or use Mono/Core on a distribution of your choice.
  • Jelastic Cloud (PaaS) : deploy your ASP.NET Core applications via Docker containers in a few clicks with automatic horizontal scaling.
  • Public Cloud: for high-availability infrastructures using OpenStack, ideal for microservices architectures.

Has this FAQ been helpful?

This guide helps you protect your resources against hotlinking on your Infomaniak Web Hosting.

 

Preamble

  • Hotlinking occurs when a third-party site displays your images, videos, or music by directly using the URL of your server; the remote site uses your resources and server power at your expense, often without citing the source.
  • Although bandwidth is more generous today, hotlinking remains a problem for protecting your copyrights and avoiding unnecessary overloading of your server.

 

Prevent hotlinking via .htaccess

You can block these unauthorized accesses by adding rules to the .htaccess file at the root of your site. Here is an optimized version including modern image formats (WebP, AVIF):

RewriteEngine on

# 1. Autoriser les requêtes avec un Referer vide (certains navigateurs pour la vie privée)
RewriteCond %{HTTP_REFERER} !^$

# 2. Autoriser votre propre site (remplacez par votre domaine)
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?votre-domaine\.com [NC]

# 3. AUTORISER LES MOTEURS DE RECHERCHE (Indispensable pour votre SEO)
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\. [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing\. [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yahoo\. [NC]

# 4. Bloquer le hotlinking (renvoie une erreur 403 Forbidden)
RewriteRule \.(jpg|jpeg|png|gif|svg|webp|avif)$ - [F,NC,L]

Recommendations:

  • Replace: change your-domain\.com with your actual domain name.
  • SEO: only remove the Google/Bing lines if you intentionally want your images to never appear in search results.
  • Alternative 403: the rule above uses [F] (Forbidden). This is more ecological and performant than loading a replacement image that still consumes bandwidth.
Tip: If you use a CDN like Cloudflare in front of your Infomaniak hosting, you can enable "Hotlink Protection" with one click in their management interface.

Has this FAQ been helpful?

This guide presents commands that can be executed to test a connection or a network and thus specify the source of a potential error.

 

Perform a Telnet...

TELNET allows you to test the connection to a server without considering all the additional settings of a mail or FTP application in order to determine the origin of a problem. If the connection does not go through on an SMTP server, for example, you will need to check if your firewall is not blocking port 587 or 465.

 

... on macOS

  1. Search for Network Utility.
  2. Go to the Ping, Lookup, or Traceroute tab depending on what you want to test.
  3. You can also use a Terminal type application (command line interface, CLI / Command Line Interface) on your device and, depending on what you want to test, enter:
    traceroute [server]
    nc [server] [port]
    Replace [server] with the server name or its IP address, same for [port]...

 

... on Windows

Enable Telnet if necessary.

  1. Use a Terminal type application (command line interface, CLI / Command Line Interface) on your device, for example by typing Run then cmd.
  2. In the window that opens, depending on what you want to test, type:
    tracert [server]
    telnet [server] [port]
    Example: telnet mail.infomaniak.com 587 (allows you to test the SMTP port if your software/email client does not allow sending emails)...

 

... on Android

  1. Use the application Simple Telnet Client which allows you to test very simply via 2 fields to fill in (for example mail.infomaniak.com and port 143 or 993)...

 

Perform a PING

PING allows you to know if a machine is accessible via the Internet. You can also check with this tool if you are addressing the correct machine, for example during a DNS change, by looking at the IP address obtained. It is possible to perform a ping on a domain name, a hostname or an IP address.

PING is definitely blocked on shared hostings.


Has this FAQ been helpful?

This guide explains how to work without the PECL SSH2 client module, which is unavailable on Infomaniak Web Hosting and Cloud Servers, by using the phpseclib library instead. This library works with native PHP without requiring any specific extension.

 

Preamble

  • The use of PECL SSH2 client results in errors of type No compatible key exchange algorithms found or Unable to exchange encryption keys in its latest available version.
  • Phpseclib allows:
    • SSH authentication via password or private key.
    • Remote command execution.
    • Secure file transfer (SFTP).
    • SSH key management.

 

Using phpseclib

To integrate an SSH connection into a PHP script, use phpseclib as follows:

use phpseclib3\Net\SSH2;
use phpseclib3\Crypt\PublicKeyLoader;

$ssh = new SSH2('domain.xyz');
$key = PublicKeyLoader::load(file_get_contents('/path/to/private_key'));

if (!$ssh->login('utilisateur', $key)) {
    exit('Authentication Failed');
}

echo $ssh->exec('ls -la');

Has this FAQ been helpful?

This guide details the priority actions to take if you do not see any difference between your website after a change you have made to it, and its previous version. These tips are also valid if you encounter issues while using the Infomaniak product interface.

 

Preamble

  • During your browsing, a web browser saves the data consulted in a reserved space, in order to avoid requesting the data already consulted from the server again, to save time and resources.
  • Your cache may contain a lot of data and sometimes the browser gets confused. Sites may then display incorrectly or display an outdated version.
  • Clearing the cache ensures that you have the very latest version of the page or folder consulted.

 

Clear the web browser cache …

 

… on Safari

Choose your macOS version to view the corresponding Apple help.

 

… on Google tools (Chrome, Android, etc.)

View the Google help.

 

… on Firefox

View the Mozilla help.

 

… on Edge / Internet Explorer

View the Microsoft help.


Has this FAQ been helpful?

This guide details the features available for managing relational databases on Infomaniak hosting.

 

Use of Views, Triggers, Stored Procedures, and Routines

Regarding the management of relational databases, the view functionality ("views") is available by default, allowing users to create views to simplify data management and presentation.

However, some advanced features that allow for more precise and complex data manipulation, such as…

  • triggers (triggers)
  • stored procedures ("stored procedures")
  • routines
  • and the creation of functions

… are only available on Managed Cloud Servers.

They are not allowed on shared servers.

This restriction is mainly due to potential risks to the stability of the infrastructure. Poor configuration or excessive use of these features could create infinite loops or significant overloads, affecting not only the performance of the affected server but also the experience of all clients hosted on the same infrastructure.

 

Resolving a MySQL/MariaDB dump import issue

When exporting and then re-importing a MySQL or MariaDB database via the Infomaniak hosting interface, it may happen that the operation fails due to errors related to the DEFINER of triggers or views. This occurs when the database objects were created with a specific user (called definer) who no longer exists at the time of import.

Concretely, the export and import process uses a temporary user, used only during these operations. After this user is deleted, the views or triggers defined with this account as DEFINER become invalid, causing errors of the type:

General error: 1449 The user specified as a definer ('xxxx_temp_1'@'%') does not exist

 

To avoid this problem, it is possible to correct the backup file (dump.sql or dump.sql.gz) before importing it by replacing the definer definitions with CURRENT_USER. This automatically attaches the triggers and views to the current user at the time of import.

Here is an example of a command to modify the dump before import:

sed -E 's/DEFINER=`[^`][^`]*`@`[^`][^`][^`]*`/DEFINER=CURRENT_USER/g' dump.sql > dump-corrected.sql

 

Once this replacement is done, the corrected file can be imported normally via the Infomaniak Manager. This behavior is known and related to the operation of temporary users during dump/restore. No changes to the export/import process are planned in the short term, but the subject remains under evaluation on the infrastructure side.

For more information about the CURRENT_USER variable, refer to the official documentation of:


Has this FAQ been helpful?

This guide explains how to change the password of a MySQL / MariaDB database from a Web Hosting.

 

Preamble

  • Refer to this other guide if you are looking for information about updating connection information (scripts, sites...) related to a database password change.
  • A database user created following the installation of a Web Application (offered by Infomaniak) cannot be modified (a lock icon appears next to it, see point 5 below).
  • To access the database to which it is attached, you must create a new database user with the password of your choice and then assign rights to the desired database.

 

Change MySQL MariaDB password etc.

To do this, you need to intervene on the user attached to the database in question and change the password (without having to provide the old one) from the Infomaniak Manager:

  1. Click here to access the management of your product on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the product in question.
  3. Click on Databases in the left sidebar.
  4. Click on the Users tab.
  5. Click on the action menu ⋮ located to the right of the item in question.
  6. Click on Modify:
  7. Click on Change password.
  8. Enter the desired new password.
  9. Click on the Save button:
  10. If necessary, you can configure the new possible rights (read/write/administration) of the user for access to existing databases on the hosting.

Has this FAQ been helpful?

This guide explains how to start a content analysis of a Web Hosting to detect and clean files containing viruses and other malicious scripts that could threaten the security of websites.

 

Start an antivirus scan of the sites

To analyze potentially infected content:

  1. Click here to access the management of your hosting on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the hosting concerned.
  3. Click on Security in the left sidebar:
  4. Click on Antivirus in the left sidebar.
  5. Click on the blue button Analyze:
  6. Select the site(s) to analyze.
  7. Click on the blue button Start the analysis:

 

The antivirus scan may take some time, but the Manager can be closed. You will receive an email when the operation is complete.

 

Also consider the vulnerability detection tool to monitor potential vulnerabilities automatically corrected on your websites.


Has this FAQ been helpful?

This guide explains how to quickly install applications, PHP extensions, and technologies (non-exhaustive list below) in a few clicks on Managed Cloud Server only.

 

Refer to this other guide if you are looking for information about additional Web Applications that can be installed on any type of hosting, including standard/shared offers.

 

Install (or uninstall) apps / PHP extensions…

To find the list of technologies and proceed with their installation:

  1. Click here to access the management of your Managed Cloud Server on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the Managed Cloud Server concerned:
  3. Click in the left sidebar:
    1. PHP Extensions
    2. Fast Installer
  4. Click on the action menu to the right of the extension you want to uninstall in the table that appears.
  5. Click on Uninstall.
  6. Otherwise, click on the blue button Install an extension / Install an application:
  7. Then make your choice for a new installation:

 

Non-exhaustive list of available apps & extensions

  • AdvanceCOMP
  • BuildEssential
  • electron_dev
  • ExifTool
  • FFmpeg ↗ guide
  • Ghostscript
  • Gifsicle
  • GraphicsMagick
  • HAProxy
  • Imagemagick ↗ guide
  • Jpegoptim
  • libjpeg_turbo
  • libqrencode
  • libX11_xcb1
  • MidnightCommander
  • Memcached ↗ guide
  • mongoDB ↗ guide
  • NVM Node Version Manager
  • OptiPNG
  • p7zip
  • PDFtk
  • PHP_APCu
  • PHP_CLI ↗ guide
  • PHP_FPM
  • PHP_GnuPG (obsolete extension) ↗ guide for the PHP pure alternative
  • PHP_gRPC
  • PHP_igbinary
  • PHP_IonCube ↗ guide
  • PHP_OPcache
  • PHP_PDF
  • PHP_PDO_ODBC ↗ guide
  • PHP_Swoole
  • pip
  • Pngcrush
  • Pngquant
  • Redis ↗ guide
  • RRDTool The Round Robin Database Tool
  • RubyCompass
  • systemd ↗ guide
  • tesseract_ocr
  • varnish ↗ guide
  • virtualenv
  • WebP
  • xauth
  • xpdf
  • xvfb
  • ZSH

Has this FAQ been helpful?

This guide explains how to change the password of an FTP or FTP/SSH account for an Infomaniak Web Hosting site.

 

Change the password of an existing FTP user

To access the site on Web Hosting to modify its FTP access:

  1. Click here to access the management of your hosting on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the hosting concerned:
  3. Click on FTP/SSH in the left sidebar menu.
  4. Click on the action menu to the right of an existing account.
  5. Click on Modify:
  6. Enter the new password that will be used for your FTP or SSH access directly.
  7. If necessary, you can generate a strong password.
  8. Confirm the changes:

Has this FAQ been helpful?

This guide explains how to change the target folder where your Website is stored on an Infomaniak Web Hosting.

 

Preamble

  • On an Infomaniak Web Hosting, it is possible to install several Websites with their own domain name (multisite management).
  • Each of these sites is stored in a folder of your hosting, which is the target of the site. It is possible to freely modify the target of a site. Example:
    • The site domain.xyz has as a target, for example, the folder /web
    • You publish a site in a new subfolder of /web named, for example, /web/v2
    • By modifying the target /web of the site domain.xyz to /web/v2, the site domain.xyz will show the content of the folder /web/v2 without obviously including this path in the browser's address bar and without leaving access to any files still located in /web.
  • It is recommended not to create "v2" in a subfolder of "web" but next to it, by creating the folder at the root of your hosting.
  • These folders actually exist on the server, but you are not required to connect via FTP to manage them.

 

Display the folder of your Websites

To find the information about the folder in which your site is stored:

  1. Click here to access the management of your site on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the site in question.
  3. Then, click on the chevron to expand the Information section of this site.
  4. The indication highlighted below is the location of the example site:

 

Modify the target or folder of a Website

To manage the location of a Website within the hosting:

  1. Click here to access the management of your product on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the product in question.
  3. Click on Manage in the Advanced Settings section:
  4. Manage the desired location for the site.
  5. Click the button to Save at the bottom of the page:

Has this FAQ been helpful?

This guide helps identify and correct 404 errors, blank pages or websites that do not display when it is impossible to reach the hosting from your browser.

 

Points to check

It is strongly recommended to perform the following steps:

  1. Check the Internet connection: visit a third-party site such as https://www.ch.ch or https://www.microsoft.com. If these addresses are inaccessible, contact your Internet Service Provider (ISP) as the problem comes from your connection.
  2. Clear the browser cache to force the page to refresh; learn more.
  3. Test the site's visibility by third parties: ask acquaintances outside your local network to test access or use the service https://downforeveryoneorjustme.com to find out if the site is down for everyone or just for you.
  4. Use a proxy to simulate a connection to your site from another geographical location.
  5. Check that the domain name has not expired: hosting and domain are two separate entities. Your hosting may be active at Infomaniak (check it on the Manager) while the domain has expired. Perform a WHOIS and contact the registrar if necessary.
  6. Check the configuration file of your script or CMS to verify the database connection information (name, address, user and password); learn more.

 

If the problem persists

Please contact Infomaniak support in writing by providing the following information:

  1. Name of the affected site.
  2. Your public IP address at the time of testing (available on https://www.infomaniak.com/ip).

If you encounter a problem with third-party software, contact its publisher or a Partner and consult the support policy as well as article 11.9 of the Infomaniak Terms of Service.


Has this FAQ been helpful?