1000 FAQ, 500 Anleitungen und Lernvideos. Hier gibt es nur Lösungen!
Ändern der Serverkonfiguration einer Website
This guide explains how to modify the server configuration of a site on Infomaniak Web Hosting.
Introduction
- Apache is the HTTP server.
- It is configured with a
.htaccess
file placed at the root of the website.
- It is configured with a
- 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 take effect in the folder and subfolders where the .user.ini file is located.
- It is possible to customize PHP directives with a
- Refer to this other guide regarding the creation of .htaccess / .user.ini files.
Modify the Server Configuration of a Site…
… via the Manager
To modify the PHP configuration and most parameters (max_input_vars
, allow_url_fopen
, memory_limit
, post_max_size + upload_max_filesize
, etc.):
- Click here to access your product management in the Infomaniak Manager (need help?).
- Click directly on the name assigned to the relevant product.
- Click on Manage under Advanced Settings:
- Click on the different tabs General, PHP/Apache, and PHP Extensions to make the desired adjustments:
Don't forget to save the changes at the bottom of the page.
Refer to this other guide if you are looking for information regarding limit values and the possibilities for unlocking them.
… via the .user.ini file
For PHP directives that are not present on the Manager side, it is necessary to define the desired values in the .user.ini
file, e.g.:
max_file_uploads = 20
The list of existing directives can be found on the official PHP site, but items marked with PHP_INI_SYSTEM
in the Modifiable
column, as well as max_input_time
, memory_limit
, and mysqli.default_socket
cannot be used.
… in CLI
To customize PHP directives when executing scripts via the command line (CLI) or in CRON jobs, it is necessary to specify the desired values in a .user.ini
file.
Then, to apply these configurations, use the PHP executable with the -c
option followed by the path to the .user.ini
file.
For example, to modify the available memory limit for PHP to 1024M, you can create or modify the .user.ini
file using the following command:
echo 'memory_limit = 1024M' > .user.ini
This command writes the memory_limit
directive with the value 1024M into the .user.ini
file.
Then, when executing a PHP script via the command line or in a CRON job, you will use the PHP command with the -c
option to specify the .user.ini
file containing the custom configurations.
The following example activates allow_url_fopen
for the WP CLI tool (which allows for retrieving extensions, etc.):
php -d allow_url_fopen=On ~/bin/wp package install trepmal/wp-revisions-cli
php
: the PHP executable-d allow_url_fopen=On
: the-d
option allows setting a PHP configuration directive (allow_url_fopen
) with the valueOn
~/bin/wp
: path to the WP CLI executablepackage install trepmal/wp-revisions-cli
: the specific command to install the WP CLI packagetrepmal/wp-revisions-cli
This ensures that the allow_url_fopen
option is enabled while executing the specified WP CLI command. Enabling allow_url_fopen
may be necessary for certain operations that involve opening remote URLs, such as downloading extensions or packages. Ensure that this option is enabled securely and in accordance with best security practices.