1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Modify a site's server configuration
This guide explains how to modify the server configuration (.user.ini; .htaccess) of a site on Infomaniak Web Hosting.
.htaccess or .user.ini file?
Apache is the HTTP server. It is configured with a .htaccess file placed at the root of the website.
PHP is a programming language used to create dynamic web pages via an HTTP server. It is possible to customize PHP directives with a .user.ini file, which will be effective in the folder and subfolders of the location of the .user.ini file.
⚠️ Important: modifying the .user.ini file may take several minutes to take effect.
Modify the server configuration of a site
via the Manager
To modify the PHP configuration and most settings (max_input_vars, allow_url_fopen, memory_limit, etc.):
- log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- click on the icon in the top right corner of the interface (or navigate through the left side menu, for example)
- choose Website (Web & Domain universe)
- click on the name of the object in the displayed table
- click on the Advanced Settings
- click on the PHP or Apache tab to make the desired adjustments
via the .user.ini file
For PHP directives not present in the Manager, it is necessary to set the desired values in the .user.ini file.
For example:
max_file_uploads = 20
The list of existing directives can be found on the official PHP website, but items marked "PHP_INI_SYSTEM" in the "Changeable" column as well as max_input_time, memory_limit, and mysqli.default_socket are not usable.
via CLI
To customize PHP directives via a Command Line Interface (CLI) or in CRON tasks, it is necessary to set the desired values in a .user.ini file and then call the PHP executable with the -c .user.ini option.
The following example changes the available memory for PHP:
~/web$ echo -e ' ' >memory-limit.php
~/web$ php memory-limit.php
memory_limit: 512M
~/web$ echo 'memory_limit = 1024M' >.user.ini
~/web$ php -c .user.ini memory-limit.php
memory_limit: 1024M
~/web$
The following example enables allow_url_fopen for the WP CLI tool (allows retrieving extensions, for example):
php -d allow_url_fopen=On ~/bin/wp package install trepmal/wp-revisions-cli