Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains how to import a MySQL/MariaDB database on a Infomaniak Web Hosting.
Import a database
To import a Infomaniak database:
- 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 Databases in the left sidebar.
- Click on the button/menu “More actions” for more options.
- Choose Import a database:
- Follow the wizard to the end.
You will then have the choice…
- … to send your database directly (
sql
,gz
,bz2
,zip
, max 300 Mo) from your computer - … to select the file to import from your hosting after uploading it to the server via FTP
… and also as an option:
- import the data into a new database (creation)
- import into an existing database (replacement/overwrite)
Alternative method (SSH - for advanced users)
Prerequisites
- Have the
.sql
file of the database to import. - Have created a new blank database.
- Have a user who has all rights on the database.
- Have a FTP + SSH account.
To import via SSH:
- Send the database to import via FTP to your hosting.
- Open an SSH terminal/console,
- From a terminal-type application (command line interface, CLI/Command Line Interface) on your device, for example the application PuTTY (to download and install on Windows) or Terminal (installed by default on macOS), run and adapt the following command:
ssh ftp-user@adresse-du-serveur‍
- Replace
ftp-user
with the username of the FTP + SSH account (e.g.,abcd_user
) - replace
adresse-du-serveur
with the web server address of your hosting
- Replace
- Enter the password for the FTP + SSH account.
Enter and adapt the following command:
mysql --verbose -u db-user -p db-name -h db-host < path‍
- replace
db-user
with the database username (e.g.,abcd_user
) - replace
db-name
with the name of the database (e.g.,abcd_sample
) - replace
db-host
with the MySQL server of your hosting - replace
path
with the path where you sent the database in step 1 of this procedure (if you have a single website stored in the default location, the path would be for example~/web/test.sql
)
- replace
- Wait during the import (this may take several minutes depending on the size).
This guide details the priority actions to take if you do not see any difference between your website after a change you made to it, and its version before the change. These tips are also valid if you encounter issues while using the Infomaniak product interface.
Preamble
- While browsing, a web browser saves the data viewed in a reserved space, this to avoid asking the server again for the data already viewed, to save time and resources.
- Your cache can contain a lot of data and sometimes the browser gets confused. Websites may then display incorrectly or show 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
Select your macOS version to view the corresponding Apple help.
… on Google tools (Chrome, Android, etc.)
Refer to the Google help.
… on Firefox
Refer to the Mozilla help.
… on Edge / Internet Explorer
Refer to the Microsoft help.
This guide provides basic instructions for creating and using a .htaccess
and .user.ini
file with an Web Hosting Infomaniak.
Preamble
- A
.htaccess
file is placed at the root of a website and allows you to configure the Apache HTTP server.- As a decentralized configuration file, it offers significant flexibility to adjust the server's behavior according to the specific needs of the site.
- This file allows you to define URL rewrite rules, impose access restrictions, manage HTTP errors, and even customize security aspects such as disabling the display of files/folders.
- It also facilitates the implementation of redirects and aliases, thus providing precise control over the organization and accessibility of the site.
- A
.user.ini
file allows you to customize the PHP directives of the folder (and its subfolders) in which it is located.- By acting at the PHP interpreter level, this file allows you to define specific configurations for a given folder and its subdirectories.
- With its clear syntax, it offers the possibility to modify various parameters such as memory limit, script execution time, error handling, and other PHP-related directives.
- This granular approach allows developers to finely customize PHP behavior according to the specific requirements of each section of the site.
Create a file…
… .htaccess
- Log in to your hosting via FTP or SSH.
- At the root of the relevant website, create a new file and name it:
.htaccess
. - Enter the desired directives in the file; refer to these other guides for example:
… .user.ini
- Log in to your hosting via FTP or SSH.
- In the desired location, create a new file and name it:
.user.ini
. - Enter the desired PHP configuration parameters in the file.
⚠️ Modifying the .user.ini
file takes several minutes to take effect.
This guide explains how to enable support for certain file types (e.g., .inc
) by PHP on an Infomaniak Web hosting so that they are processed in the same way as a .php
file.
Preamble
- Previously, you had to add the following line in a
.htaccess
file:AddType application/x-httpd-php .inc
- This prevented the file's content from being displayed as text instead of being correctly interpreted by PHP when accessed via a browser.
- Now you can manage file extensions via the FPM Extensions field in your hosting Manager.
Manage extensions recognized by PHP
To add support for a specific file type:
- 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:
- Edit the FPM Extensions field to make the desired addition:
Do not forget to save the changes at the bottom of the page.
This guide helps you set up the header "Access-Control-Allow-Origin
", an HTTP header that specifies which origin (domain, protocol, and port) can access resources on a server. This header is used to control cross-origin (CORS) access from a web application.
⚠️ For additional help contact a partner or launch a free tender — also discover the role of the host.
Allowed domains list
You can add the origin of a request to the list of authorized domains to access the server's resources by adding it to the values of the Access-Control-Allow-Origin
header.
To allow, for example, the site https://domain.xyz
to access resources with CORS, the header must be as follows:
Access-Control-Allow-Origin: https://domain.xyz
You can set this via the header()
function of PHP by drawing inspiration from this guide in particular.
If you need this header to be applied everywhere, you can use an auto-prepend.
This guide concerns the database management features available on Infomaniak servers.
MySQL, SQLite, MariaDB, PostgreSQL…
At the level of Database Management System, Infomaniak servers support…
- … MySQL databases via PHP MySQL access or via Perl DBI+DBD::mysql
- You can use MySQL as a database management system (DBMS) on Infomaniak servers.
- You can access it either via PHP using the built-in MySQL database functions of PHP, or via Perl using the DBI and DBD::mysql modules
- … MySQLI, the native MySQL access interface (PHP5)
- MySQLI is a PHP extension that allows access to a MySQL database.
- It is an improved and more recent version of the old MySQL extension of PHP, offering enhanced features and performance.
- … SQLite 3.x
- SQLite is a lightweight, self-contained, serverless SQL database engine.
- Infomaniak servers support SQLite version 3.x, which means you can use SQLite to store data on these servers.
- … MariaDB
- MariaDB is a fork of MySQL and is often used as an alternative to MySQL
- You can therefore use MariaDB as a database management system on Infomaniak servers
- … the PGSQL module
- PGSQL is a PHP module that allows you to connect to a PostgreSQL database
- This specific feature allows you to connect to a REMOTE PostgreSQL database via PHP; this requires opening the appropriate port to the precise IP of the PostgreSQL database from the Infomaniak manager.
This guide explains how to update Web Applications installed via Infomaniak tools.
Preamble
- If an application is manually updated via FTP, it is then impossible to update it via the Manager and benefit from automatic updates.
- When installing your Web Application, automatic updates (at least security updates) are usually enabled by default:
Updating an application installed via Infomaniak
To access the Infomaniak Web Application and update it:
- 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 the action menu â‹® located to the right of the relevant Web Application.
- Click on Settings for the application:
- Click on Edit in the Information block:
- Click on the dropdown menu to select a newer version.
- Click on the Save button:
This guide explains how to enable or disable the PHP function set_time_limit
for a Web Hosting.
Preamble
set_time_limit
is a PHP function that sets the expiration time of a script, in seconds; if this limit is reached, the script stops and returns a fatal error.set_time_limit
cannot be used to set values beyond the script execution time limit (max_execution_time) set in the Manager.
Enable or disable the PHP function set_time_limit
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.
- Click the toggle switch button On/Off as desired:
- Click the Save button to confirm the changes.
This guide explains how to add or modify one or more CNAME
and DNAME
type records in the DNS zone (of a domain name) managed on the Manager Infomaniak.
Preamble
- The
CNAME
record type allows pointing a subdomain to a website address.- This is the method generally used to operate the
www
subdomain with your site, or to redirect a subdomain to a folder on the web server where your website is hosted.
- This is the method generally used to operate the
- The
DNAME
record type for «delegation name
» is particularly useful when reorganizing domains or for smooth transitions of part of your infrastructure to another, while preserving the hierarchical structure of subdomains.- A
DNAME
creates an alias for an entire domain and all its subdomains.
- A
- Unlike a
CNAME
which applies to a single specific host name, aDNAME
automatically redirects all subdomains. Example:- A
DNAME
forabc.site1.com
pointing tosite2.com
will automatically linkxyz.abc.site1.com
toxyz.site2.com
,new.login.abc.site1.com
tonew.login.site2.com
, and so on.
- A
- âš A
DNAME
record cannot be used at the root level of a domain (such assite1.com
directly). It is generally used on a subdomain. If you want to redirect the main domain itself, you will need to use other types of records such as anA
,AAAA
orCNAME
(with some restrictions for the latter).
Modify the DNS zone
Refer to this other guide to manage this type of record in a DNS zone.
This guide explains how to backup or export a MySQL/MariaDB database via the Manager or by SSH.
Export a database via the Manager
To export an Infomaniak database:
- 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 Databases in the left sidebar.
- Click on the action menu â‹® to the right of the relevant item in the displayed table.
- Click on Export (or on Download a backup):
- Click on the export method and select the database to download from the drop-down menu.
- Click on the Next button.
- Click on any desired instructions:
- Compression
Gzip
Drop Table
Create Table if not exists
Insert ignore into
- Compression
- Click on the Export button.
Export a database via SSH
If you are unable to export the database via the console or if the database is large:
- If necessary, create an FTP SSH account.
- Log in to the server via SSH (need help?).
Adapt and run the following SSH command:
mysqldump --host=votre_serveur_mysql -u votre_user_mysql --password=password_du_user_mysql nom_de_la_base_de_données --no-tablespaces > sauvegarde.sql
- Wait while the SSH command is being executed (the terminal may freeze for a few seconds).
- Log in to the server via an FTP software/client.
- Download the generated SQL file.
Additional help
Example command to run in step 3 of the second procedure:
mysqldump --host=fhzc.myd.infomaniak.com -u lfcz_test --password=monpassword lfcz_test --no-tablespaces > sauvegarde.sql
- Refer to this other guide if you are looking for information related to the MySQL server, the database username and password.