Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains how to activate the following functions on Web hosting (in italics, Cloud Server Only:
proc_open
popen
exec()
shell_exec()
set_time_limit
passthru
system
These functions are disabled by default as they pose a significant security risk in the event of hacking a website. Only activate them if there is a real need (for a script or CMS ImageMagick, Typo3, CraftCMS, etc.).
Enable PHP functions
To access website management:
- Click here in order to access the management of your product on the Manager Infomaniak (Need help?).
- Click directly on the nameallocated to the product concerned:
- Click on Manage under Advanced Parameters:
- Click on the tab PHP / Apache.
- Click on the toggle switch button On/Off as desired:
- Click on the button Save to validate the changes.
This guide explains why there is a file /icons/
within the Web hosting Infomaniak.
Folder /icons/ on your Web Hosting
In some cases, a file named /icons/
is by default present on your web hosting. This folder is generally accessible via HTTP, but is not visible in the FTP tree (www.domain.xyz/icons/
).
This directory /icons/
is often used to store specific icons or images used to display directory lists. These icons are usually used by web servers to visually represent the different types of files in directories when viewed via a browser.
This guide provides precise information on the management of the development environment ASP
(Active Server Pages, aspx) within the Infomaniak infrastructure.
Support for ASP
Web hosting services and Cloud Servers are based on a Apache server architecture that does not support Apache module natively::ASP.
However, there is the possibility to install and configure this ASP environment onVPS Cloud Infomaniak.
This guide explains how to add IP addresses to the whitelist of a Web site Infomaniak.
Preamble
- Allow IP on
xmlrpc.php
allows access to URLs that are blocked by default, as judged to be at risk. - This type of blocking is effective on all recent servers.
- Concerning WordPress, its functionality XML-RPC is only available by default via Infomaniak services and JetPack for security purposes.
Add IP addresses to the white list xmlrpc.php
To access website management:
- Click here in order to access the management of your product on the Manager Infomaniak (Need help?).
- Click directly on the nameallocated to the product concerned:
- Click on Manage under Advanced Parameters:
- Click on the tab PHP / Apache.
- Complete the relevant line:
- Click on the button for save.
This guide explains the differences between Area (or main site), a Sub-domain and one Alias.
Preamble
- Although they are related, these three elements (Domain, Subdomain and Alias) have different functions and purposes.
- They can impact a Web hosting via its domain name, or even the e-mail Since it is quite possible to have email addresses on a subdomain e.g.
What is a Domain?
The domain or domain name, is the main gateway to your website. It is from it that your users will access your content. It is this main domain that defines what will appear in your users' browsers' URL bar.
Prerequisites
- Owning a field.
- Owning a Web hosting Infomaniak.
Read the guide Create a new website on your web hosting.
What is a Subdomain?
The Subdomain is symbolized by an additional word that is in front of your main domain name. This is very useful in several cases, e.g.:
- This can be used to display "exclusive" or targeted content, e.g. by going to faq.infomaniak.com you arrive on the basis of knowledge where all the guides are located
- This can also be used (temporarily or permanently) when creating a new site or redesigning an existing site, by creating e.g. new.domain.xyz when the main site was until then domain.xyz
Prerequisites
- Have at least one field.
- Owning a Web hosting Infomaniak.
Read the guide Add a subdomain to your web hosting.
What is an Alias?
An Alias or Domain Alias is a second domain name that points directly to your main site, they share the same web pages. The alias is another gateway to your website. P.ex the main website of Infomaniak Network SA is www.infomaniak.com and www.infomaniak.ch is his alias.
The interest of an Alias is to allow you to increase the visibility of your site with your target by offering it more entrance doors to access it.
Prerequisites
- Owning more than one domain names.
- Owning a Web hosting Infomaniak.
Read the guide Add an alias to your web hosting.
The equivalent also exists for Mail Service.
This guide explains how to set up a WordPress multisite network to manage multiple sites from a single WordPress installation with Infomaniak (WordPress & Apps), using URLs like site1.your-domain-here, site2.your-domain-here, or even with your-domain1.com, your-domain2.com, etc.
⚠️ For additional help, contact a partner or fill out a tender — also read about the role of the host
Installing WordPress multisite
For this:
- install WordPress via Infomaniak on your hosting space
- connect via FTP
- edit the wp-config.php file
- above the line "/* That's all, stop editing! Happy blogging. */" add:
define('WP_ALLOW_MULTISITE', true);
Then go to TOOLS in your WordPress to create a network.
Follow the instructions. You will need to:
- remove any SSL certificates
- deactivate WordPress plugins
Adding sites to your WP network
For this:
- in WordPress, go back to TOOLS > Network Setup
- choose the method of creating your different WordPress sites (on subdomains)
- add the necessary details in wp-config.php and .htaccess on the server
- after reconnecting to your WordPress, you will get a new "My Sites" menu where you can add and manage your different sites from the same network
- on the Manager, add an alias to your site in the form *.your-domain-here (the asterisk allows you to create a wildcard alias) with DNS update so that the correct CNAME is automatically added to the zone
- when you create a new site within the network, naming it for example site1, it will become accessible via site1.your-domain-here and so on
Subdomain and whole domain
Right after adding to the WordPress network, you have the option to modify the URL of the added site:
Click on Edit Site to specify the complete URL:
This guide solves a type error "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 time interval beyond which the connection is closed: http://dev.mysql.com/doc/refman/5.7/en/gone-away.html
- Variables wait_timeout and interactive_timeout which control this disconnection are at 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 automatically restore it before continuing with your request. Here is an example in PHP:
if (!mysqli_ping($connexion)) {
mysqli_close($connexion);
$connexion = mysqli_connect($host, $user, $password, $database);
}
The function mysqli_ping()
check if the connection is still valid. If it is not, the script closes the connection and opens a new one.
Sending regular "Ping"
Another way is to run a script that regularly sends a "ping" to the database to keep the connection active. P.ex you could create a planned task (cron job) that sends a light request, like SELECT 1;
at regular intervals.
Adjusting MySQL (Cloud Server) Settings
With a Cloud Server, you can increase variable values wait_timeout
and interactive_timeout
since the MySQL menu of your server to extend the duration of the connection before it is closed.
This guide explains how to solve a .csv file import problem in a MySQL table.The proposed alternative is to read the CSV file line by line using PHP and insert the data into the MySQL database.
"load data local infile" function disabled
The function LOAD DATA LOCAL INFILE
allows to import a CSV file into a MySQL table and is now unfortunately frequently used by hackers to get access to certain sites hosted on machines accepting this function.
To combat malicious acts and continue to protect customers' data as much as possible, Infomaniak has deactivated the function LOAD DATA LOCAL INFILE
Not affected by this modification are people importing their CSV files (provided they do not check "CSV via LOAD DATA") via phpMyAdmin.
Here is an alternative to continue importing data in CSV format into a MySQL table, a complete example of the code with correct error management for opening the CSV file and inserting the data into the database.
This version uses mysqli
to connect to the database and the requests prepared to insert the data, thus providing better security and compatibility with recent versions of PHP and ease of implementing it in your PHP script or simply in a new PHP file in your directory /web:
$NomDuFichier = "data.csv";
// Connexion à la base de données MySQL avec mysqli
$link = new mysqli("localhost", "username", "password", "database");
// VĂ©rification de la connexion
if ($link->connect_error) {
die("Échec de la connexion : " . $link->connect_error);
}
// Ouverture du fichier CSV en lecture
if (($handle = fopen($NomDuFichier, "r")) !== FALSE) {
// DĂ©composition de chaque ligne du fichier CSV
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
// Préparation de la requête SQL
$query = "INSERT INTO `test` VALUES (" . str_repeat('?,', count($data) - 1) . "?)";
$stmt = $link->prepare($query);
// Vérification de la préparation de la requête
if ($stmt === FALSE) {
die("Échec de la préparation de la requête : " . $link->error);
}
// Liaison des paramètres
$types = str_repeat('s', count($data)); // Assume que toutes les colonnes sont de type string
$stmt->bind_param($types, ...$data);
// Exécution de la requête
if (!$stmt->execute()) {
die("Échec de l'exécution de la requête : " . $stmt->error);
}
// Fermeture de la déclaration
$stmt->close();
}
// Fermeture du fichier CSV
fclose($handle);
} else {
echo "Erreur : impossible d'ouvrir le fichier.
";
exit(1);
}
// Fermeture de la connexion à la base de données
$link->close();
?>
Get help
Unfortunately, it is not possible to tell you exactly where these lines of code should be added to your script.
⚠For additional assistance contact a partner or launch a call for tenders free of charge — discover also the role of the host.
If the proposed alternative poses a problem when you submit several CSV files to read and the e.g. procedure ends without sending a message despite the message management points in the PHP file, it is possible that the tables and fields used are poorly indexed and in this case also contact your webmaster.
See PHP documentation for fgetcsv
: http://php.net/manual/fr/function.fgetcsv.php
This guide explains how to customize the boundaries of a site hosted on a Web hosting mutualised or a Cloud Server.
Unlocking or adjusting the boundaries of a site
To access website management:
- Click here in order to access the management of your product on the Manager Infomaniak (Need help?).
- Click directly on the nameallocated to the product concerned:
- Click on Manage under Advanced Parameters:
- Click on the tab PHP / Apache.
In particular, you can:
- Unlock for 60 minutes the memory limit (
memory_limit
= 1280 MB) and the maximum running time of scripts (max_execution_time
= 60 minutes):- This release 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 sending, in MB)- Cloud server only:
Max children
(be aware of this other guide) - Cloud server only:
Max input time
Do not forget to save the changes at the bottom of the page.
Maximum values by type of accommodation
Limits | Mutualized | Cloud Server | CLI (Cloud Server only) |
---|---|---|---|
max_execution_time | 300 s | 3600 s | 0 (limited) s max |
memory_limit | 1280 MB | 2048 MB max | 512 MB max |
post_max_size + upload_max_filesize | 9223372026854775807 MB max | 9223372026854775807 MB max | 48 MB max |
max_children | 20 max | 20 (default, editable) | |
simultaneous IP connections | 30 max | 30 (default, editable) | |
max_input_time | 0 (limited) | 0 (default, editable) | 0 (limited) |
files (inodes) | no limit on the number of files per hosting |
This guide presents the Diagnosis DNS which makes it possible to verify that the relations between...
- NAME OF FIELD at Infomaniak
and
- WEB-BASED ACCOMMODATION at Infomaniak
... are quite correct, so that the traffic Web is heading to the right place.
Preamble
- To check, the tool controls records A, CNAME, etc.
- You will be able to do so. detect and correct certain web issues especially if they are related to DNS (technical information that basically determines where to direct a particular web traffic) by acting at the level of your domain.
- Correction automatic is possible only when the domain name is present on the same Organization as the product to which it is to be attached.
- If this is not the case then the correction will have to be done manually.
Diagnosis of a DNS problem
To access the DNS diagnosis of your domain name:
- Click here in order to access the management of your product on the Manager Infomaniak (Need help?).
- Click directly on the nameallocated to the product concerned.
- Click on Web in the left side menu.
- Click on Diagnosis DNS in the left side menu:
- If DNS problems are detected, a red display on the table will indicate this:
- Correct each error individually by clicking on the action menu to the right of the item concerned...
- ...or all the mistakes at once...
- ... or if necessary and you are sure of yourself, ignore these warnings.
- If DNS problems are detected, a red display on the table will indicate this:
Be aware of this other guide about this same automatic verification process but for Mail Services.