Results 1 to 8 of 8

Thread: parsing html as php.

  1. #1

    parsing html as php.

    I know you can set apache to parse all html as php, but I don't know how, could someone let me know?

    If anyone has done this I'd also like to know how much of a difference it makes, with the increased overhead of doing this.

    ta.

  2. #2

    Re: parsing html as php.

    do you mean ALL pages, or pages with .php, or how to build php as an apache module?

  3. #3

    Re: parsing html as php.

    If you want your .html files to be parsed by php, look into httpd.conf (/etc/apache/httpd.conf for me) and look for

    Code:
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
    change it to

    Code:
      AddType application/x-httpd-php .php .html
      AddType application/x-httpd-php-source .phps

    leo.

  4. #4

    Re: parsing html as php.


    Code:
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
    change it to

    Code:
      AddType application/x-httpd-php .php .html
      AddType application/x-httpd-php-source .phps
    I wouldn't change the first into the second, I'd just add the second in right after the first. That way you can still use a .php file, if you want.

  5. #5

    Re: parsing html as php.

    Right I'll try this tomorrow, thanks. I don't need it any more*, but I'll give it a go.


    Was doing a tutorial, dicked about with the code, got it working, Thanks anyway guys

  6. #6
    Guest

    Re: parsing html as php.

    Hey popcorn, let me know how that goes. That would be fairly handy.

  7. #7

    Re: parsing html as php.

    Works like a charm. Thanks elo.

    Just as a note to anyone else wanting to try this, I had to edit commonhttpd.conf not httpd.conf, so check for both.

    Fetzaa: with that code you can still use .php (It's still on the AddType line)

  8. #8

    Re: parsing html as php.

    Oops, I'm an idiot. I didn't notice the first time around that you had both php and html in the same line. I thought you were making it so that it parsed HTML as PHP, but not PHP.

    ;D

Similar Threads

  1. PHP Tutorial
    By Waka-Gashira in forum Windows - General Topics
    Replies: 8
    Last Post: 01-27-2005, 08:10 AM
  2. PHP on IIS Server
    By genesis in forum Windows - General Topics
    Replies: 8
    Last Post: 01-03-2005, 11:22 AM
  3. Replies: 4
    Last Post: 06-19-2004, 09:35 AM
  4. PHP not working in RH8
    By Pleiades in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 02-24-2003, 12:17 PM
  5. PHP takes ASP as Number 1 SSSL
    By coltrane in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 07-04-2002, 03:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •