Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

How do I confiure server so I can embed php code in html page under webmatrix

$
0
0

 

I am trying to embed php code in my html pages on my godaddy linux hosted site. I am aware of howtos that will instruct me how to do this on godaddy by editing my .htaccess file in Apache.

My problem is that I want to develop locally under windows webmatrix2.

What needs to be done under a windows server running iis or webmatrix as server? My godaddy account is hosted under linux but I develop under windows using webmatrix. The main symptom that my webmatrix server is not parsing php code in my .html pages is that there is no keyword color coding and intellisense does not work. I want to use php in my html website because php is so useful and there are so many good php routines out there.

Solutions I have found that don't work.

1) According to one source add these lines to the applicationhost.config file

<add name="PHP53_via_FastCGI_html" path="*.html" 
   verb="GET,HEAD,POST" modules="FastCgiModule" 
   scriptProcessor="C:\Program Files (x86)\iis express\PHP\v5.3\php-cgi.exe"
   resourceType="Either" />

under the iisexpress directory. They crash my entire local site.

2) In Webmatrix, In the web.config file for the site add in this rewrite rule.

<system.webServer>
  <rewrite>
    <rules>
        <rule name="REWRITE_TO_PHP">
        <match url=".html" />
        <conditions logicalGrouping="MatchAll" />

        <action type="Rewrite" url=".php" />
            </rule>
    </rules>
</rewrite>
... more code 

3) or try this in web.config

<rewrite>
    <rules>

        <rule name="REWRITE_TO_PHP">
        <match url="*.html" />
        <conditions logicalGrouping="MatchAll" />
        <action type="Rewrite" url="{"*.Php"} />

    </rule>
</rewrite>

4) or try this in web.config

<handlers>
<add name="html via php cgi" path="*.html" verb="*" modules="FastCgiModule" 
scriptProcessor="C:\Program Files\Php\php-cgi.exe" 
resourceType="Unspecified" />
</handlers> 

None of the above work for me. I know all of the above this is a lot of information. This is all I have been able to find in lengthy web searches. I am not a system coder by experience. I just need something that works that will allow me to start coding php in html on windows. The key breakthrough will be if I start seeing my php displying in keyword colors and have webtrix intellisense work! Intellisense is great! Thank you.


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>