1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

How to set PHP engine to parse PHP in HTML file

Discussion in 'Plesk for Windows - 8.x and Older' started by slpc, Jul 6, 2004.

  1. slpc

    slpc Guest

    0
     
    Greetings,

    I know how to do this on my Linux boxes, but not on the Windows '03 box.

    Once in a while I make PHP exits in my HTML code for things like copyright/date/etc. However, I have many sites that end in ".html" instead of ".php" and the ".html" pages will not be parsed by the PHP engine on my Windows boxes.

    I'm using Plesk 6.5 and since PHP was installed via Plesk, I'm curious if anyone knows of a configuration setting that I can set to allow PHP exits in HTML code to be parsed even if the extension is ".html"
     
  2. softpac2000

    softpac2000 Guest

    0
     
    Here is an example:

    As long as you start the php code with "<?php" and end it with "?>" that's all there is to it!...

    Ex:
    <?php phpinfo(); ?>

    Hope this helps!
    Ricardo...:cool:
     
  3. slpc

    slpc Guest

    0
     
    Actually, this isn't true. I've been writing PHP for quite a few years now... I know how to code. But I've only done it for use on Red Hat/Apache. The code will NOT be parsed on IIS6 if my pages do not end in ".php" when I try to exit into PHP code within the HTML. ('exit' meaning <?php... ..?>)

    I believe I need to map ".html" to the PHP parser (ISAPI or DLL possibly?) but am not sure how to do this in IIS.
     
  4. softpac2000

    softpac2000 Guest

    0
     
    When I say that's all that needs to be done is assuming you have Plesk installed and you have PHP enabled for that domain.

    The extension and parser should have already been assigned by Plesk.

    This is done by Plesk when it is installed!...

    If for some reason you want to do this manually there is two places in IIS 6 where you would need to make changes...

    This is located in IIS... Right click on the only IP address visible under websites in IIS... and then click on properties... Within one of those tabs there is a button you need to click which will bring you another window that has all the extensions and parsers.... I don't have IIS in front of me so can't tell you the exact tab where this is located...

    There should already be an entry for ".php" with the php.exe assigned to it as the parser.

    Also in the left pane of IIS 6 the last item at the bottom is where you authorize what runs and what doesn't in IIS. This should have been done by Plesk already too....

    Any other changes need to be done in the php.ini file located in the Windows directory. Check the PHP help file for additional info on that! It should be there!

    Hope this helps!
    Ricardo...:cool:
     
  5. slpc

    slpc Guest

    0
     
    Let me try this again, because we're not communicating effectively here...

    1. Plesk 6.5 is installed on Win03 Server

    2. I figured this should be configured by Plesk when it's installed... but if it is, it ain't working! 'Regular' PHP files parse just fine (those ending with '.php'). However, .html files will not parse php. Want an example? Here: www.netpublishhost.com/php.html

    This file contains:

    <html>
    <head>
    <title>PHP PARSE TEST</title>
    </head>
    <body>
    <?php echo "Make this **** work"; ?>
    </body>
    </html>

    As you can clealy see, the PHP is not parsing, so if Plesk sets it up automatically to do this, then something is wrong and Plesk did not get it setup correctly. By the way, if I change the extension on that file to '.php' it works just fine.

    On top of that, if I right-click my site in IIS Admin, go to 'props', click 'home directory', click 'configuration', I do NOT see .php or .html in there! I see .asp, .shtml, etc. but no .html or .php.

    Furthermore, the second I try to add ".html" and point it to anything (including php.exe) I can no longer visit the site, I get a '404' or 'Not Found'. And once I remove the '.html' mapping that I just added, the site is still broken until I do a 'restore' of the metabase!

    This should provide even more info: http://forums.servermatrix.com/viewtopic.php?t=8384
     
Loading...