Valid for Linux Web Hosting and Managed Dedicated Servers.

With your own php.ini file, you can customise PHP settings such as the upload limit for your website. This guide shows you how to create the configuration file, upload it to your web space, and check that the changes have been successfully applied.

What is a php.ini file?

The php.ini is a configuration file for PHP. It consists of simple text instructions, the so-called directives, which are structured according to the scheme directive = value.

You can use a php.ini file to customise PHP settings for your website. For example, you can increase the upload limit for files, or activate server-side compression to optimise the loading time of your website.

Here is an example of a php.ini configuration:

upload_max_filesize = 128M
zlib.output_compression=1
zlib.output_compression_level=9

The entries explained:

  • upload_max_filesize = 128M: Increases the maximum file size for uploads to 128 megabytes (default: 64 MB).
  • zlib.output_compression = 1: Activates data compression to speed up your website. The value 1 stands for "On".
  • zlib.output_compression_level = 9: Defines the compression level (scale from 1 to 9).

Which PHP settings can I change?

A complete overview of all PHP directives that you can change at IONOS can be found in this Help Centre article: Which PHP settings can I change?

Customize PHP settings in 3 steps


Step 1: Create php.ini file

 

  • Open a simple text editor (e.g. Notepad on Windows, or TextEdit on macOS).

  • Insert the desired configuration instructions. Write each instruction on a new line. An example:

    upload_max_filesize = 128M
    zlib.output_compression = 1
    zlib.output_compression_level = 9

  • Save the file under the name php.ini. Make sure that no additional extension, such as .txt, is appended.

 

Step 2: Upload php.ini file

 

Web hosting contracts purchased before September 15, 2025

Upload the created php.ini file to the directory in your webspace where you want the settings to apply. You can use Webspace Explorer or an SFTP program such as FileZilla to do this.

Instructions for uploading files can be found here:
Uploading a file using Webspace Explorer
Transferring files with FileZilla using SFTP

Web hosting contracts purchased from September 15, 2025

Upload the created php.ini file to the /home/www/ directory.

To upload the php.ini file, you can use Webspace Explorer or an SFTP program such as FileZilla.

Please Note

Important notes on uploading:

  • Do not overwrite existing php.ini files: If a php.ini file already exists in the directory, download it first to save your previous configurations. Then add your new instructions and upload the edited file again.
  • Validity for subdirectories: 

    Web hosting contracts purchased before September 15, 2025
    The php.ini file only applies to the directory in which it is located. To apply the settings to all subdirectories, the file must be copied to each individual directory. You can learn how to automate this with a script in the article "Applying PHP settings to all subdirectories".

     

    Web hosting contracts purchased from September 15, 2025
    The php.ini file must be located in the /home/www/ directory. The settings in the php.ini file will then be automatically applied to all subdirectories.
    Configuring custom settings for individual subdirectories is not possible. Furthermore, the php.ini file will not be taken into account if it is located in a different directory.

    For the change to take effect, you must connect to your web space via SSH and enter the command apachectl restart. How to connect to your webspace via SSH is described in the article “Connecting to your webspace via Secure Shell (SSH) using PuTTY”.

Step 3: Check the effectiveness of the changes


To check whether your new settings are active, you can display the PHP system information:

  • Create a new file with the name info.php and the following content:

    <?php phpinfo(); ?>

  • Upload this file to the same directory where your php.ini is located.
  • Open the page in your browser according to the following scheme: https://domain.tld/path/info.php. Adjust your domain name and the path to info.php accordingly.
  • The script displays all active PHP settings. Use your browser's search function (Ctrl + F or Cmd + F) to quickly find the directive you have changed.

Please Note

Delete the info.php file from your webspace after the check so that sensitive server information does not remain publicly accessible.

Further information