htm与php问题 [英] htm vs. php problem

查看:75
本文介绍了htm与php问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的公司使用.htm扩展程序及其php代码。那里

是一个页面,有很多查询,我有问题

。使用.htm扩展名加载

页面需要30多秒,例如,将从数据库中提取大约30行。如果我只是将
的扩展名更改为.php,则加载

相同页面所需的时间不到1秒,并且将从数据库中提取超过300行。有什么想法为什么这个

正在发生?

The company I work for uses .htm extensions with their php code. There
is one page which has quite a few querys that I am having problems
with. With the .htm extension it will take 30+ seconds to load the
page and, for example, will pull approx 30 rows from the db. If I just
change the extension to .php, it takes less than 1 second to load the
same page, and will pull over 300 rows from the db. Any ideas why this
is happening?

推荐答案

2006年12月18日星期一08:24: 30 -0800,Andrew写道:
On Mon, 18 Dec 2006 08:24:30 -0800, Andrew wrote:

我工作的公司使用.htm扩展程序及其php代码。那里

是一个页面,有很多查询,我有问题

。使用.htm扩展名加载

页面需要30多秒,例如,将从数据库中提取大约30行。如果我只是将
的扩展名更改为.php,则加载

相同页面所需的时间不到1秒,并且将从数据库中提取超过300行。任何想法为什么这个

正在发生?
The company I work for uses .htm extensions with their php code. There
is one page which has quite a few querys that I am having problems
with. With the .htm extension it will take 30+ seconds to load the
page and, for example, will pull approx 30 rows from the db. If I just
change the extension to .php, it takes less than 1 second to load the
same page, and will pull over 300 rows from the db. Any ideas why this
is happening?



一名男子去看医生说:Doc,当我这样做时会疼!

A man goes to the doctor and says: "Doc, It hurts when I do this..."




Ivan Marsh写道:

Ivan Marsh wrote:

On Mon,18 Dec 2006 08:24:30 -0800 ,Andrew写道:
On Mon, 18 Dec 2006 08:24:30 -0800, Andrew wrote:

我工作的公司使用.htm扩展名及其php代码。那里

是一个页面,有很多查询,我有问题

。使用.htm扩展名加载

页面需要30多秒,例如,将从数据库中提取大约30行。如果我只是将
的扩展名更改为.php,则加载

相同页面所需的时间不到1秒,并且将从数据库中提取超过300行。任何想法为什么这个

正在发生?
The company I work for uses .htm extensions with their php code. There
is one page which has quite a few querys that I am having problems
with. With the .htm extension it will take 30+ seconds to load the
page and, for example, will pull approx 30 rows from the db. If I just
change the extension to .php, it takes less than 1 second to load the
same page, and will pull over 300 rows from the db. Any ideas why this
is happening?



一名男子去看医生并说:Doc,当我这样做时会疼!


A man goes to the doctor and says: "Doc, It hurts when I do this..."



伊万,我知道你说的是什么......但是使用.php扩展名是

。有什么建议我可以告诉他们为什么这个

会发生吗?

Ivan, I know what you are saying...but going with .php extensions is
out of my control. Any suggestions I can bring up to them to why this
happens?


Andrew写道:
Andrew wrote:

我工作的公司使用.htm扩展名及其php代码。那里

是一个页面,有很多查询,我有问题

。使用.htm扩展名加载

页面需要30多秒,例如,将从数据库中提取大约30行。如果我只是将
的扩展名更改为.php,则加载

相同页面所需的时间不到1秒,并且将从数据库中提取超过300行。任何想法为什么这个

正在发生?
The company I work for uses .htm extensions with their php code. There
is one page which has quite a few querys that I am having problems
with. With the .htm extension it will take 30+ seconds to load the
page and, for example, will pull approx 30 rows from the db. If I just
change the extension to .php, it takes less than 1 second to load the
same page, and will pull over 300 rows from the db. Any ideas why this
is happening?



嗨安德鲁,


确实很奇怪。

人们会想到这会让确实差别不大。


请给我们更多信息。

您使用的是真正的http服务器(例如Apache)吗?或者这是在IIS上发生的吗?


对服务器的任何请求的.htm扩展是否会激发额外的进程

进行解析? (有些激动人心的CMS也许可以摆弄?)

工作中的某些(破碎)缓存机制可能仅适用于htm-extension而不是

for phpextension?


我只能猜测。


不管是什么原因,我觉得贵公司的东西设置得很尴尬。

如果你觉得冒险,修复它。


当然,停止使用html扩展来执行PHP也很有意义

太...

使用.php for php。为什么改变这样的事情?


问候,

Erwin Moller

Hi Andrew,

That is strange indeed.
One would expect that this makes little difference indeed.

Please give us some more info.
Are you using a real httpserver (Apache eg)? Or is this happening on IIS?

Will a .htm extension of any request to the server fire additional processes
for parsing? (Some excotic CMS maybe that fiddles around?)
Some (broken) caching mechanism at work maybe for htm-extension only and not
for phpextension?

I can only guess.

Whatever the reason, I think something is set up awkwardly in your company.
If you feel adventurous, fix it.

And of course, stopping to use html extension to execute PHP makes sense
too...
Use .php for php. Why change such a thing?

Regards,
Erwin Moller


这篇关于htm与php问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆