Newbie needs help with parsing

Discussion in 'Apache' started by lionclaw, Aug 5, 2007.

  1. #1
    I have just installed Apache Server 2.0.52 and PHP (5.2.3) on my home computer (Windows XP) so that I can learn PHP and practice using other web technologies more easily. The installations seemed to go alright, as I followed directions as closely as possible. For the most part they are working adequately EXCEPT for parsing PHP in HTML files. As a newbie I am probably making some obvious mistake, but no matter how much I play around with the configurations I cannot get the PHP to work in the html files. I even adding a .htaccess file with:

    Remove handler .html .htm
    Add type application/x-http-php .php .htm .html


    as someone suggested, but this too didn't help.
    The lines I played around with the most in the httpd.conf file are:

    AddType application/x-httpd-php .php .htm .html
    AddType text/html .shtml .html .htm .php
    AddHandler server-parsed .shtml .html .htm .php
    AddOutputFilter INCLUDES .shtml


    Can someone please set me straight?

    Thank you
     
    lionclaw, Aug 5, 2007 IP
  2. bilal@revolutionhosting

    bilal@revolutionhosting Peon

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is PHP working within .php files? Or not at all?

    If it's working within .php files, and you have PHP loaded as an Apache server module (mod_php), then the only line you should need is:

    AddType application/x-httpd-php .htm .html

    If it's *not* currently working in .php files, check to make sure you have the configuration line:
    LoadModule php5_module "c:/php/php5apache2.dll"
    (obviously adjust the path for your system)

    See the following page in the PHP manual for further information:
    http://www.php.net/manual/en/install.windows.apache2.php
     
  3. lionclaw

    lionclaw Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    PHP is loading with .php files. Not with .html though.
     
    lionclaw, Aug 5, 2007 IP
  4. lionclaw

    lionclaw Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ahhaaa. Success!
    I got rid of everything else and ONLY put
    AddType application/x-httpd-php .htm .html
    and it works.
    Thanks
     
    lionclaw, Aug 5, 2007 IP