For ASP.NET Hosting (Windows Hosting)

The PHP scripting language is essential for the operation of many PHP based websites such as WordPress. The ASP.NET hosting packages from IONOS support multiple PHP versions. In this article, we will show you how to configure the PHP version for your website.

Available PHP versions

The following PHP versions are currently available on the Windows platform:

  • PHP 8.4: The latest stable version.
  • PHP 8.3: From July 9, 2025 it will be the standard version on the Windows platform (previously it was PHP 8.1).
  • PHP 8.1: Will expire on December 31, 2025 (End of Life) and then removed from the platform around January, 2026. We recommend switching to a newer version as soon as possible.


By default, the ASP.NET hosting platform is still set to PHP 8.1. From July 9, 2025, PHP 8.3 will be the default setting. Below, we will show you how to select your desired PHP version.
 

Summary of the process

The conversion of your ASP.NET web hosting to the desired PHP version is done by editing or creating the configuration file web.config:

  • You download the web.config file from your webspace or create a new file if it does not yet exist.
  • Add or replace the <handlers> section in the file as described below for the respective PHP version.
  • Upload the modified or new file to your webspace. This activates the selected PHP version immediately.

We will guide you through the necessary steps below.

Change PHP version in existing web.config file

If a web.config file already exists for your website, customise it as follows to use the desired PHP version:

  • Download the web.config file from the root directory of your webspace to your computer.

    You can either use the Webfiles file manager from IONOS or your FTP access. More information can be found here:
    Starting Webfiles in IONOS
    Transferring Files via FTPS with WinSCP
     
  • Create a backup copy of the web.config file on your computer.
  • Open the web.config file on your computer with a simple text editor such as Notepad.
  • Look for a section in the text that begins with the line <system.webServer> and ends with the line </system.webServer>.

    <system.webServer>
    ...
    ...
    </system.webServer>

  • Add the following code at the end of the section before the line </system.webServer> :

    For PHP 8.4:

    <handlers>
      <remove name="PHP83" />
      <remove name="PHP81" />
      <remove name="PHP8" />
      <add name="PHP84" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP84\php-cgi.exe" resourceType="File" />
    </handlers>


    For PHP 8.3 (standard as of July 9, 2025):

    <handlers>
      <remove name="PHP84" />
      <remove name="PHP81" />
      <remove name="PHP8" />
      <add name="PHP83" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP83\php-cgi.exe" resourceType="File" />
    </handlers>


    For PHP 8.1 (EOL from December 31, 2025):

    <handlers>
      <remove name="PHP84" />
      <remove name="PHP83" />
      <remove name="PHP8" />
      <add name="PHP81" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP81\php-cgi.exe" resourceType="File" />
    </handlers>

    Please note that the expression <add name="PHPXX" ... /> (where XX stands for the version) must be in one line. The text displayed in this guide may be wrapped in our example due to the layout. It is best to copy the complete <handlers> block from above and paste it into the web.config file. The <remove> instructions ensure that previously active PHP handlers are removed.

  • Save the changes.
  • Upload the edited web.config file back to your webspace.

Please note

Changes to the web.config configuration file automatically affect all subdirectories. If you have several PHP websites and only want to activate the PHP version for one website for the time being, upload the edited web.config to the directory of the website in question.

The selected PHP version is now immediately active. Reload your website in your browser and check that everything works as usual.

To change or remove the PHP configuration again if necessary, adjust the corresponding lines in your web.config file again or remove the <handlers> section for PHP.

Set PHP version with new web.config file

If there is no web.config file in your webspace, simply create one:

  • Open a simple text editor such as Notepad on your computer.
  • Copy the code from the appropriate code template in the next section (for PHP 8.4, 8.3, or 8.1) and paste it into the text editor.
  • Save the file under the name web.config.
  • Upload the finished web.config to your webspace.

Templates: web.config file for specific PHP versions

The following code serves as an example of a minimalist web.config file. It already contains the instructions for switching to the respective PHP version. You can use this code as a copy template for creating your web.config file.

 

Template for PHP 8.4
 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
   <defaultDocument enabled="true">
    <files>
     <clear />
     <add value="index.aspx" />
     <add value="index.asp" />
     <add value="index.htm" />
     <add value="index.html" />
     <add value="home.aspx" />
     <add value="home.asp" />
     <add value="home.htm" />
     <add value="home.html" />
     <add value="default.aspx" />
     <add value="default.asp" />
     <add value="default.htm" />
     <add value="default.html" />
    </files>
   </defaultDocument>
     <handlers>
       <remove name="PHP83" />
       <remove name="PHP81" />
       <remove name="PHP8" />
       <add name="PHP84" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP84\php-cgi.exe" resourceType="File" />
     </handlers>
  </system.webServer>
</configuration>


Template for PHP 8.3 (standard as of July 9, 2025)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
   <defaultDocument enabled="true">
    <files>
     <clear />
     <add value="index.aspx" />
     <add value="index.asp" />
     <add value="index.htm" />
     <add value="index.html" />
     <add value="home.aspx" />
     <add value="home.asp" />
     <add value="home.htm" />
     <add value="home.html" />
     <add value="default.aspx" />
     <add value="default.asp" />
     <add value="default.htm" />
     <add value="default.html" />
    </files>
   </defaultDocument>
     <handlers>
       <remove name="PHP84" />
       <remove name="PHP81" />
       <remove name="PHP8" />
       <add name="PHP83" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP83\php-cgi.exe" resourceType="File" />
     </handlers>
  </system.webServer>
</configuration>

 

Template for PHP 8.1 (EOL from December 31, 2025)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
   <defaultDocument enabled="true">
    <files>
     <clear />
     <add value="index.aspx" />
     <add value="index.asp" />
     <add value="index.htm" />
     <add value="index.html" />
     <add value="home.aspx" />
     <add value="home.asp" />
     <add value="home.htm" />
     <add value="home.html" />
     <add value="default.aspx" />
     <add value="default.asp" />
     <add value="default.htm" />
     <add value="default.html" />
    </files>
   </defaultDocument>
     <handlers>
       <remove name="PHP84" />
       <remove name="PHP83" />
       <remove name="PHP8" />
       <add name="PHP81" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP81\php-cgi.exe" resourceType="File" />
     </handlers>
  </system.webServer>
</configuration>