Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Modify server configuration (legacy hosting)

Infomaniak never modifies, upon request, system configuration files such as php.ini, my.ini or httpd.conf. However, you can adjust certain PHP parameters in two ways:

 

1. Modify parameters via PHP code

You can use the ini_set() function directly in your PHP code:

Syntax

<?php ini_set('nom_du_paramètre', 'valeur'); ?>

Example

<?php ini_set('display_errors', 'off'); ?>
// Disable error display

 

2. Modify parameters via a .htaccess or .user.ini file

For hosting using the new Infomaniak console, it is recommended to use a .user.ini file rather than a .htaccess.

Syntax

php_flag "nom_du_paramètre" "on/off"
php_value "nom_du_paramètre" "valeur"

Examples

php_flag display_errors "off"
# Disable error display

php_flag allow_url_fopen "On"
php_flag allow_url_include "On"
# Enable fopen, fsockopen, file_get_contents, simplexml_load_file, etc.
# Helps resolve errors such as:
# "URL file-access is disabled in the server configuration"
# "Fatal error: main() [function.require]: failed to open stream"
# "get_headers(), file_get_contents(), etc."

php_flag detect_unicode "off"
# Disable automatic Unicode detection

php_flag short_open_tag "off"
# Disable short PHP tags (<? ?>) to prevent XML parsing issues

php_value register_globals "0"
# Disable Register Globals (enabled by default in some configurations)

php_value magic_quotes_gpc "1"
# Enable Magic Quotes GPC function (see: http://php.net/manual/en/security.magicquotes.php)

AllowOverride None
# Modify the AllowOverride directive (ALL by default)

 

In images

You can create a .htaccess or .user.ini file and insert the necessary directives:

 

Learn more

The memory_limit and max_execution_time limits are set at the Apache configuration level and cannot be modified.


Has this FAQ been helpful?