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. Configuring Parsing of the AUTOEXEC.BAT File
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-04-2005, 08:56 AM
  2. Help with html
    By boblucci in forum Linux - Software, Applications & Programming
    Replies: 8
    Last Post: 07-12-2004, 02:04 PM
  3. Parsing PDF files with vim?
    By Tyr_7BE in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 05-13-2002, 09:57 AM
  4. vim and html
    By NGene in forum Linux - Software, Applications & Programming
    Replies: 7
    Last Post: 04-13-2002, 02:00 PM
  5. need help with html
    By boblucci in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 01-29-2002, 09:39 PM

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
  •