Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains what the "MySQL Prefix" option is for in a site's settings and what its implications are for the operation of your web applications (CMS) and PHP scripts.
Preamble
- When the "MySQL Prefix" option is enabled for a site, it is no longer necessary to add the prefix "
wxyz_
" in front of the name and users of your MySQL databases. - A PHP script can thus connect to MySQL with the user "monuser" and a database "mabase" and access will automatically be granted with the user "wxyz_monuser" and the database "wxyz_mabase".
- âš If you are migrating from an older Infomaniak offer:
- After migrating a site from the old console, the "MySQL Prefix" option is enabled by default to automatically maintain the connection of your web applications (WordPress, Joomla, Drupal, etc.) and PHP scripts with your MySQL databases.
- To ensure the proper functioning of your sites in case of migration of your hosting to another server, it is strongly recommended to disable this function and make the necessary adjustments.‍
Manage the MySQL Prefix option
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.
- Turn the toggle switch MySQL Prefix on or off.
- Click the Save button:
- Make the necessary adjustments in the configuration files of your Web applications and PHP scripts…
Implications and adjustments to make
After disabling the MySQL Prefix option for a site, some PHP scripts or CMS may no longer function. To restore the connection to your databases, you must update the following information in the configuration file(s) of the affected scripts:
- The name of the MySQL database: you will need to add the prefix of your server to it
- before:
mabase
- after:
wxyz_mabase
- before:
- The MySQL database user: you will need to add your server prefix to it
- before:
monuser
- after:
wxyz_monuser
- before:
This guide concerns Laravel, an open-source web framework written in PHP following the model-view-controller (MVC) principle. Also refer to their documentation.
For additional help, contact a partner or launch a free tender — also discover the role of the host.
Prerequisites
- Have a Shared Web Hosting or Cloud Server with the latest MySQL/MariaDB.
- Site running PHP 8.2.
- Create an SSH access.
- Create a database.
Installation of Laravel 11
For this:
- Log in to the server via SSH (need help?).
- Navigate to the site directory by running the command “cd chemin-vers-le-site” (for example
cd sites/laravel.domain.xyz
). - Create a new project by running the command
composer create-project laravel/laravel example-app
. - Modify the
.env
file at the root of the hosting to update the connection parameters for the new database:- DB_CONNECTION=mysql
- DB_HOST=xxxx.myd.infomaniak.com
- DB_PORT=3306
- DB_DATABASE= the name of the MySQL database (xxxx_newbdd)
- DB_USERNAME= the MySQL user with rights to this database
- DB_PASSWORD= its password
- Navigate to the project directory and publish via SSH:
cd example-app
php artisan migrate
- Modify the target directory to point to the "public" subdirectory of the project, here
/sites/laravel.domain.xyz/example-app/public
.
This guide concerns MySQL/MariaDB and more particularly the analysis of indexes and queries with the Web Hosting.
Slow log for long queries
The MySQL slowlog is enabled on all MySQL servers and groups queries that take more than 5 seconds* to execute. If your queries are well constructed, you will never see these files. Otherwise, check regularly to correct any potential issues and ensure the proper functioning of your site.
Contact Infomaniak support in writing to obtain them (except for the old v1 hosting, which can be viewed directly from the FTP Manager one level above /web
in the /logs
directory).
And the logs?
No MySQL log is created (except for slowlogs) as the servers would absolutely not support the load of recording millions of simultaneous logs. If needed, Infomaniak can activate this MySQL log for 5 minutes to allow you to analyze them with EXPLAIN
and determine useful indexes for example. To do this, contact Infomaniak support in writing.
* elapsed time. And regarding locks, the documentation provides the following clarification: "The time to acquire the initial locks is not counted as execution time
This guide explains how to add an alias domain to a domain name.
Introduction
- A synonym domain is a domain name that can serve as a secondary name for another domain.
- When a synonym domain is added, it automatically inherits the content of the DNS zone of the main domain (including
MX
,A
records, etc.), as well as its Web and Mail hosting. - Alternatively, you can also add a (domain) alias to a website or add a (domain) alias to a Mail Service.
Add a synonym domain to a domain
Prerequisites
- The domain name of the future synonym or the management of its DNS zone…
- … must be reserved with Infomaniak,
- … must be configured with the Infomaniak DNS,
- … must not yet be linked to any product.
- The domain name to which the synonym will be added…
- … must not be associated with the Infomaniak Newsletter product.
To access your domain names:
- 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 Synonym domains in the left sidebar.
- Choose to add a synonym.
- Click on Next:
- Select an existing domain within the current Organization, or order a new domain in advance, and click the button to Confirm:
Refer to this other guide if you are looking for information on how to dissociate a synonym domain name.
This guide explains how to change the password of a FTP or FTP / SSH account for a Web Hosting site.
Change the password of an existing FTP user
To access the site on a Web Hosting to modify its FTP access:
- 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 FTP / SSH in the left sidebar.
- Click on the action menu â‹® to the right of the relevant user in the displayed table.
- Click on Edit:
- Enter the new password that will be used for your FTP or SSH access directly.
- If necessary, you can generate a strong password.
- Confirm the changes:
This guide helps resolve a potential 530 error by reducing the number of simultaneous FTP connections to Web Hosting.
Resolve error 530
The error message 530 Sorry, the maximum number of clients (25) for this user are already connected
generally appears due to multiple and simultaneous connections with an FTP software/client that poorly manages disconnections or tries to open several connections at once to speed up the download.
Once you have encountered this error, you must close the FTP program and then wait 30 minutes so that the server terminates the active connections and you can reconnect.
You can also create a new FTP user and connect with it.
To avoid this situation with FileZilla, go to the menu Edit -> Settings then under the Transfers tab and set the number of simultaneous transfers to 2.
It is recommended to use the FTP Manager.
This guide explains how to delete an alias domain from an Infomaniak Web hosting. The main domain name of the site will then no longer be linked to any other domain name.
This notably allows you to create a new web hosting or distinct site for the domain name that has been unlinked.
Prerequisites
- Have dissociated the synonym domain from the main domain if there was an association previously.
Remove the alias domain
To remove an alias domain from your site:
- 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:
- Then click on the chevron ‍ to expand the Domains section of this site.
- Click on the action menu â‹® to the right of the domain to remove.
- Choose Unlink:
- Confirm the removal of the alias.
This guide explains how to protect part of a site on a Web Hosting by making it mandatory to enter a password before viewing a directory (including subdirectories) from a browser.
Simple method
Password-protect (Digest authentication) a directory using the "Folder Protection" tool:
- 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 Security in the left sidebar.
- Click on Folder Protection in the left sidebar.
- Click on the directory to protect.
- Enable protection with the toggle switch and then create one or more users*:
- * Users are defined per directory; the tool does not allow managing user groups:
- * Users are defined per directory; the tool does not allow managing user groups:
- Click on the Add button.
- Click on the button to add access for an additional user if necessary.
- Click on the action menu â‹® located to the right of the user in question to modify or remove them.
- Click the toggle switch again to completely disable the folder protection:
Manual method via .htaccess
To protect a folder with a password using your site's .htaccess
file:
- Log in to your hosting via an FTP software/client or the FTP Manager.
In the folder to protect, create a file called
password.php
and adapt the following content inside by replacing12345
with the desired password:<?php $pass = "12345"; echo password_hash($pass, PASSWORD_DEFAULT); // Affiche le mot de passe chiffré ?>
- Open a web browser and display the file
password.php
(example: domain.xyz/dossier-à -protéger/password.php). - The web browser displays your encrypted password; copy the encrypted password, it will be needed later…
In the folder to protect, create a file called .htaccess
and adapt the following content inside:
AuthName "Page d'administration protégée"
AuthType Basic
AuthUserFile "/exemple/.htpasswd"
Require valid-user
Replace /exemple/
with the absolute path of the folder to protect. Example:
AuthUserFile "/home/clients/0f83c7afb710e5ae2645a1b704d8772f/web/dossier_a_proteger/.htpasswd"
In the folder to protect, create a file called htpasswd.txt
and adapt the following content inside:
login:password_chiffré
- Replace
login
with the desired login. - Replace
password_chiffré
with the encrypted password copied in step 1 of this guide.
Once the file htpasswd.txt
is saved, rename it as follows: .htpasswd
.
Open a web browser and try to display one of the pages contained in the protected folder. If the guide has been followed correctly, the chosen login and password (unencrypted) allow access to the protected folder.
Other restrictions can also be added by .htaccess
.
This guide details how, when activating a new WordPress theme, the formatting and content of articles and pages can be altered, this if the new theme does not use the same shortcodes and/or the same page builder (page constructor).
Layout issues
Here is an example of how your articles and pages may appear after changing your WordPress theme:
Unfortunately, there is no automatic solution to fix this issue: you will have to:
- either revert to the old theme you were using
- or manually adapt the content of your site with the tools provided by your new WordPress theme.
Obviously, you can also uninstall and reinstall WordPress, the site content will be erased and you will start fresh.
Avoiding future issues
Here are some tips to avoid having to reformat all the content of your site in case of a theme change:
- Use WordPress theme-specific shortcodes as little as possible.
- Use a universal page builder that is compatible with all WordPress themes (for example Visual Composer or Thrive Content Builder).
- Take the time to test and evaluate the quality of a theme by comparing it with 2-3 similar themes before using it and adapting all the content of your site.
Useful resources
- Find and automatically remove all unused shortcodes (article in English)…
This guide explains how to view a website hosted by Infomaniak even if no domain name/URL is currently correctly configured to direct the visitor to this site.
Introduction
- With the preview URL of your website, you can view the current version of your content in a browser, regardless of whether the corresponding future domain name is not yet configured correctly.
- This site preview can be done using a preview URL and notably allows you to test a site before pointing a domain name that, for example, currently points elsewhere.
- This temporary URL provided by Infomaniak may change at any time and is only available with paid offers.
Get the preview URL for your site
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 relevant product.
- Click on ‍ More information.
- The preview address is indicated under Preview URL (ex.:
XXX.preview.infomaniak.website
):
In case of trouble…
If, when visiting your preview address, the URL immediately changes to another, this may be due to a .htaccess
file that you have modified to include rewrite rules. You need to disable it and then test again.
... on WordPress
If the **preview URL** keeps displaying even though you have already configured the domain name, you need to assign the final address as the main address in your website options.
Alternatives to preview your site
If you wish to proceed differently than with the preview address provided by Infomaniak (see above), you can modify the hosts
file of your computer (including with browser extensions like this one for Firefox). You will need the IP address of your site for this.
When your tests are finished or the DNS records for the domain name are up to date, do not forget to delete any changes you have made, otherwise it will be impossible to display your site if the server's IP address is changed or if the site is migrated to another web hosting service.