PHP file slow, same file in HTML faster

This is a discussion on PHP file slow, same file in HTML faster within the PHP General forums, part of the PHP Programming Forums category; All .php files are displayed in 10 seconds (aprox). Example: test.php <html><body>hello world&...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-27-2007
Jose Toroscani Hernandez
 
Posts: n/a
Default PHP file slow, same file in HTML faster

All .php files are displayed in 10 seconds (aprox).
Example: test.php
<html><body>hello world</body></html>

But, the same file with extension html (test.html), is displayed in 1 second.


The system is:
- RHEL 5
- PHP 5.1
- Apache

I apreciate your help.

Toroscani

Reply With Quote
  #2 (permalink)  
Old 11-27-2007
AlmostBob
 
Posts: n/a
Default Re: PHP file slow, same file in HTML faster

parsing the file for php before displaying it, if there is no php in the
file dont label it .php

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
ob_start("ob_gzhandler"); else ob_start(); ?>

--
If at first you dont succeed
try try try again
If at first you do succeed
try not to look surprised

_
""Jose Toroscani Hernandez"" <toroscani@gmail.com> wrote in message
news:55ad9f850711261816j43269366t53f5e4c0612b0944@ mail.gmail.com...
> All .php files are displayed in 10 seconds (aprox).
> Example: test.php
> <html><body>hello world</body></html>
>
> But, the same file with extension html (test.html), is displayed in 1

second.
>
>
> The system is:
> - RHEL 5
> - PHP 5.1
> - Apache
>
> I apreciate your help.
>
> Toroscani
>



Reply With Quote
  #3 (permalink)  
Old 11-27-2007
Colin Guthrie
 
Posts: n/a
Default Re: PHP file slow, same file in HTML faster

Jose Toroscani Hernandez wrote:
> All .php files are displayed in 10 seconds (aprox).
> Example: test.php
> <html><body>hello world</body></html>
>
> But, the same file with extension html (test.html), is displayed in 1 second.
>
>
> The system is:
> - RHEL 5
> - PHP 5.1
> - Apache
>
> I apreciate your help.


There is probably some initialisation that PHP is doing that slowing
things down. I find that usually this kind of thing is caused by DNS
lookups and the like, but it could be any number of things. If you have
a modular build, try disabling all the PHP extensions and ensure that a
minimal system is quick then enable the extensions one by one and see
where it goes bang.

HTH

Col
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:24 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0