By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,713 Members | 1,556 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,713 IT Pros & Developers. It's quick & easy.

Does mod_php also handle static HTML?

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
zaphod wrote:
.., serves
static HTML from mod_perl processes, which is grossly inefficient.


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.
Jul 17 '05 #2

P: n/a
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:
zaphod wrote:
.., serves
static HTML from mod_perl processes, which is grossly inefficient.

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.

Jul 17 '05 #3

P: n/a
> - Are static HTML requests handled through a normal HTTPD process rather
than a mod_php process?

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
Jul 17 '05 #4

P: n/a
zaphod wrote:
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:

zaphod wrote:

.., serves
static HTML from mod_perl processes, which is grossly inefficient.

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.

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.
Jul 17 '05 #5

P: n/a
2metre wrote:

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.


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?
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.