Does mod_php also handle static HTML?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zaphod

    Does mod_php also handle static HTML?

    I've recently considered switching from mod_perl to mod_php because
    mod_perl, unless configured with multiple servers/ports/IP addresses, serves
    static HTML from mod_perl processes, which is grossly inefficient. Since I
    do not think you should have to tamper so much with server configs to do web
    development efficiently I'm considering mod_php instead. I need to know if
    PHP handles this differently:

    - Are static HTML requests handled through a normal HTTPD process rather
    than a mod_php process?

    - How does the memory/process compare for a similar script written in
    mod_perl/mod_php? Is mod_php more efficient in its use of memory?

    zaphod
  • 2metre

    #2
    Re: Does mod_php also handle static HTML?

    zaphod wrote:[color=blue]
    > .., serves
    > static HTML from mod_perl processes, which is grossly inefficient.[/color]

    err..... are you sure it does?

    It shouldn't!

    Assuming a normal httpd configuration, your server should serve static
    html directly and pass .pl through perl, .php through php.

    Comment

    • zaphod

      #3
      Re: Does mod_php also handle static HTML?

      I'm going by what I found on perl.apache.org which states that having
      anything other than separate servers/ports/IPs for dealing with static
      content is inefficient.

      2metre wrote:
      [color=blue]
      > zaphod wrote:
      >[color=green]
      >> .., serves
      >> static HTML from mod_perl processes, which is grossly inefficient.[/color]
      >
      >
      > err..... are you sure it does?
      >
      > It shouldn't!
      >
      > Assuming a normal httpd configuration, your server should serve static
      > html directly and pass .pl through perl, .php through php.[/color]

      Comment

      • René

        #4
        Re: Does mod_php also handle static HTML?

        > - Are static HTML requests handled through a normal HTTPD process rather[color=blue]
        > than a mod_php process?[/color]
        Only when you specifically configure Apache to do that, as mentioned in the
        PHP documentation, to hide the fact that it is a PHP script you can rename
        it to HTML and with the right configuration of Apache it will handle it as a
        PHP file.

        On my ISP and also in my Fedora Core 2 box default behaviour is that HTML
        are treated as static (no embedded PHP is recognized) and only PHP files are
        treated what they are. With AddHandler application/x-httpd-php .html .htm
        ..shtml in .htaccess you can change this behaviour. Wouldn't it be similar
        with mod_pl?


        --
        René
        comunica2.com
        Web Hosting, design and translations


        Comment

        • 2metre

          #5
          Re: Does mod_php also handle static HTML?

          zaphod wrote:[color=blue]
          > I'm going by what I found on perl.apache.org which states that having
          > anything other than separate servers/ports/IPs for dealing with static
          > content is inefficient.
          >
          > 2metre wrote:
          >
          >[color=green]
          >>zaphod wrote:
          >>
          >>[color=darkred]
          >>>.., serves
          >>>static HTML from mod_perl processes, which is grossly inefficient.[/color]
          >>
          >>
          >>err..... are you sure it does?
          >>
          >>It shouldn't!
          >>
          >>Assuming a normal httpd configuration, your server should serve static
          >>html directly and pass .pl through perl, .php through php.[/color][/color]
          Could you give me the context where you read "grossly inefficient"?

          If your site has no dynamic content whatsoever, then a very simple
          server configuration without any additional modules will save memory and
          CPU cycles. But if you do any processing then either perl or php modues
          will be as efficient as you get. I also use compiled CGI (C and/or
          pascal), but that requires loading a large executable into memory for
          each page served and takes up far more disk space per executable.

          Comment

          • zaphod

            #6
            Re: Does mod_php also handle static HTML?

            2metre wrote:[color=blue]
            >
            > If your site has no dynamic content whatsoever, then a very simple
            > server configuration without any additional modules will save memory and
            > CPU cycles. But if you do any processing then either perl or php modues
            > will be as efficient as you get. I also use compiled CGI (C and/or
            > pascal), but that requires loading a large executable into memory for
            > each page served and takes up far more disk space per executable.[/color]

            For similar scripts would you say a mod_php httpd process is significantly
            smaller than a mod_perl httpd process? Would statically compiled mod_perl
            with mod_php DSO mean each httpd process had both mod_perl and mod_php
            increasing the size of the process?

            Comment

            Working...