1and1 Help Centre Categories

print article

Parse PHP within HTML Files (MS 2008)

For Windows hosting packages

This article describes how to create parse PHP scripts within an HTML page for Microsoft 2008 Hosting packages. If you have ordered your package after September 1st 2010 then your package uses the Microsoft 2008 Hosting platform. If you have ordered your package before September 1st 2010 then your package uses the Microsoft 2003 Hosting platform which is not able to parse PHP.

For the server to be able to parse PHP within HTML files, you will need to add a line to the web.config file. See the example below:

<configuration>
<system.webServer>
<handlers>
<add name="PHPinHTML" path="*.html" verb="*" modules="FastCgiModule"
scriptProcessor="C:\Services\PHP\php-cgi.exe" resourceType="Unspecified" />
        
</handlers>
</system.webServer>
</configuration>

Add the line in bold above to your web.config file in between the <handlers> tag. If the <handlers> tags are not already in the web.config file, you may create them yourself.

Once the web.config has been altered and the file is saved to your webspace, all that is left to do is simply create an HTML file that includes PHP scripting. Upload the HTML file with PHP in it to your webspace and access the page via a browser.

For additional information, you may want to reference: