Valid for: ASP.NET Hosting (Windows Hosting)

Many websites, such as those built with WordPress, need the PHP scripting language to run. IONOS ASP.NET hosting packages support several PHP versions. This article explains how to set the PHP version for your website.

Available PHP versions

The following PHP versions are available or planned on the Windows platform:

  • PHP 8.6

    Available from November 30, 2026

    End of active support: not yet known

    End of security support: not yet known

  • PHP 8.5

    Available

    End of active support: December 2027

    End of security support: December 2029

  • PHP 8.4

    Available (current default version on the Windows platform)

    End of active support: December 2026

    End of security support: December 2028

  • PHP 8.3

    Available

    End of active support: December 2025

    End of security support: December 2027

Summary of the procedure

To switch your ASP.NET hosting to a different PHP version, edit or create the web.config configuration file:

  • Download the web.config file from your webspace, or create a new file if none exists yet.
  • In the file, add or replace the <handlers> section for the PHP version you want, as described below.
  • Upload the modified or new file to your webspace. The selected PHP version is activated immediately.

The following sections describe each step in detail.

Changing the PHP version in an existing web.config file

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

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

    You can use either the IONOS Webfiles file manager or an FTP program. For more information, see:

    Starting Webfiles in IONOS

    Transferring files via FTPS using WinSCP

  • Make a backup copy of the web.config file on your computer.
  • Open the web.config file on your computer in a plain text editor, such as Notepad.
  • Find the section that begins with the line <system.webServer> and ends with the line </system.webServer>:

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

  • Add the code for the PHP version you want at the end of this section, directly before the line </system.webServer>:

    For PHP 8.3

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

    For PHP 8.4

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

    For PHP 8.5

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

    For PHP 8.6 (latest version)

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

    Make sure that the <add name="PHPXX" ... /> entry (where XX stands for the version, for example 84) is on a single line without a manual line break. We recommend copying the entire <handlers> block above and pasting it into the web.config file. The <remove> entries ensure that previously active PHP handlers are removed.

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

Note

Changes to the web.config file automatically apply to all subdirectories. If you have several PHP websites and want to use the new PHP version for only one of them for now, upload the edited web.config file to the directory of that website instead.

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

To change or remove the PHP configuration later, edit the relevant lines in your web.config file or remove the <handlers> section for PHP.

Setting the PHP version using a new web.config file

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

  • Open a plain text editor on your computer, such as Notepad.
  • Copy the code from the template for the PHP version you want in the next section and paste it into the text editor.
  • Save the file as web.config. Make sure that the file is not saved with a .txt extension (for example, as web.config.txt).
  • Upload the web.config file to your webspace.

Templates: web.config file for specific PHP versions

The following templates are examples of a minimal web.config file for each PHP version.

Template for PHP 8.3

<?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="PHP86" />
      <remove name="PHP85" />
      <remove name="PHP84" />
      <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.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="PHP86" />
      <remove name="PHP85" />
      <remove name="PHP83" />
      <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.5

<?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="PHP86" />
      <remove name="PHP84" />
      <remove name="PHP83" />
      <add name="PHP85" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP85\php-cgi.exe" resourceType="File" />
    </handlers>
  </system.webServer>
</configuration>

Template for PHP 8.6

<?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="PHP85" />
      <remove name="PHP84" />
      <remove name="PHP83" />
      <add name="PHP86" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Services\PHP86\php-cgi.exe" resourceType="File" />
    </handlers>
  </system.webServer>
</configuration>