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 occurs when a MySQL connection is kept open without submitting queries 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_timeout
andinteractive_timeout
that 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:
Automatic verification and 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 re-establish it automatically 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.
Sending regular "Pings
Another method involves running 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 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)
- … never performing a single DoS or DDoS (Denial of Service) attack
- … by respecting the TOS of Infomaniak, particularly the shared services framework
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.
- This 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, here are the steps to follow:
- 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 is correctly pointing 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.
- Mention 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 like "
ifconfig
" or "ipconfig
" depending on the operating system you are using).
- Mention 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 like "
- 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 explains how to connect to an external database from a Cloud Server.
Preamble
- It is possible to connect to MySQL via SSL (external or not) - this must be specified when establishing the connection.
- The MySQL port
3306
is 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 (if not, 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 Manager Infomaniak (need help?).
- Click directly on the name assigned to the relevant product.
- Click on PHP Extensions in the left sidebar.
- Click on the blue button Install an extension.
- Select the extension
PHP_PDO_ODBC
. - 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.so
There is no need to redefine it statically in the .odbc.ini
or in the user's home directory ‍~~/.odbc.ini‍
or also dynamically in the PHP code.
Example with the driver FreeTDS
defined in advance, it is also necessary to specify the version of the driver 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 caching system on a site using the curl
command.
Introduction
- 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 sites.
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 behaves like a trash can). -H "Fastly-Debug: true"
is an HTTP header added to the request to ask for debugging information specific to Fastly.
Run the command
Run the following command from a terminal application (command line interface, CLI) 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 lists the versions of the Windows operating system that can be installed when ordering a VPS Cloud / VPS Lite.
Supported Windows Versions
When ordering your Server, you will be able to choose the version of Windows to install.
Windows Server
Possible variations 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 Mobility License, 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 Pro 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 much more.
The version 10 of Windows Professionnel Evaluation is also available.
Note:
- It will be necessary to activate Windows, Infomaniak provides only an evaluation version.
This guide concerns ImageMagick, a powerful solution for image manipulation, which you can install on a Web Hosting Infomaniak.
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 features without specifying the absolute path of the executable GD 2.x
: open-source graphics library offering similar functionalities to ImageMagick, often used in web development contextsGallery 2
: an online image gallery management platform compatible with ImageMagick
If necessary, the path for ImageMagick is standard since it is installed through the Debian repository:
/usr/bin
and for the Perl module Image::Magick
:
/usr/local/bin/convert
or 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/stream
This guide details "502 Bad Gateway" errors that can occur when visiting a website.
Introduction
- 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 hosting web server, or a misconfigured proxy server.
- Sometimes, the error may be caused by a bad entry in the DNS server.
Troubleshooting steps
To resolve the 502 Bad Gateway error, you often need to troubleshoot by elimination:
- Check if the server is not temporarily overloaded: simply reload the page after a few minutes for the error to disappear.
- Clear the browser cache.
- Try using another browser.
This guide explains how to view file activity on the server of your hosting Infomaniak.
FTP activity logs
To find out about 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.
Help reading logs: http://www.castaglia.org/proftpd/doc/xferlog.html
The user and the process "cloud base - ini
" are used within the VPS Cloud / VPS Lite infrastructure of Infomaniak (for example, in the case where the instance is rebuilt). Learn more