|
Posted by Andrew on 12/18/06 19:29
Ivan Marsh wrote:
> On Mon, 18 Dec 2006 08:46:31 -0800, Andrew wrote:
>
> > Ivan Marsh wrote:
> >> On Mon, 18 Dec 2006 08:24:30 -0800, Andrew wrote:
> >>
> >> > 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?
> >>
> >> A man goes to the doctor and says: "Doc, It hurts when I do this..."
> >
> > 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?
>
> I'm wondering how any of your code is being processed at all. The
> webserver knows what pre-processor to send a page through based on its
> extension.
>
> If your PHP code is being processed in a .htm file then the webserver must
> be set up to send .htm files through the PHP pre-processor. Which mean all
> of your webpages are being sent through the pre-processor whether they
> have any code to process in them or not. Needless to say this is causing a
> greatly increased load on your webserver.
>
> I'm sorry that I don't have any constructive ideas about the difference in
> performance but it's difficult to troubleshoot an issue that is obviously
> being caused by a webserver that has been, evidently, purposefully
> incorrectly configured.
>
> The one thing that I can think of, depending on what webserver you're
> running, is that it might be confused as to what language it's seeing when
> you run a script based on what languages that webserver processes by
> default.
>
> I'd suggest if you're using the short tags <? to try the long tags <?php
> and see if that straightens it out.
That was it. The short tags were causing the problem. Unfortunely, the
code on other pages are littered with them as well. I guess we have a
lot of work to do. Plus now I have to try to convince them to lose the
..htm and make some upgrades. I've only been with the company for a
month, so hopefully they will hear me out. Thank you everyone for your
input.
Navigation:
[Reply to this message]
|