Page 1 of 1
php hesitates 5 seconds
Posted: Sun Apr 04, 2010 9:38 am
by MAtkins
Hi:
I've got a MySql database app that I decided to do in php.
I'm running it on a Windows box in IIS.
When I run it I'm noticing that it seems to hesitate for about 5 to 10 seconds.
The page & form comes up right away but then it waits before completing the page load.
My php code is mostly at the top of the page and in includes (require_once).
Is there anything I can do to find the hesitation and make the page load quickly?
Also, I've got a bit of a caching problem.
I used:
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
which seems to work but this looks like overkill maybe?
What is the best way to insure that the DATA is fresh?
Re: php hesitates 5 seconds
Posted: Sun Apr 04, 2010 3:19 pm
by MAtkins
It takes SEVEN seconds to deliver this page:
I"m running Windows IIS.
Cached pages are useless in a database application.
Is there any way to speed this up?
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php echo "Testing 1, 2, 3"?>
</body>
</html>
Re: php hesitates 5 seconds
Posted: Sun Apr 04, 2010 8:08 pm
by lunarnet76
in case it helps PHP official no-cache is
Code: Select all
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
so apparently the last modified is useless, but you have it good, so it does not come from the caching!
Are you sure your computer is powerful enough, that you are not running the web server from the network or from a usb key?^^ just asking the obvious but we never know ...
otherwise try to use php-recommended.ini with a newly installed iis ! or ban microsoft from your life

Re: php hesitates 5 seconds
Posted: Mon Apr 05, 2010 10:50 am
by MAtkins
Thanks for the reply.
I run ASP and ASP.NET applications on that server with no problem.
The page, including any data it pulls, comes up right away but something is keeping the page load from completing.
Surely someone else has experienced this.
The code in the previous post is about as simple a php page as I can dream up.
That page shouldn't take anywhere near 7 seconds to load but it does.
Can anyone please give me an idea as to what might be causing it and how to get it to stop hesitating?
Re: php hesitates 5 seconds
Posted: Tue Apr 06, 2010 10:43 am
by Technocrat
IF you remove all the PHP code and just have HTML does it take that long to serve it up?
How did you install php? LAMP? IIS? FastCGI?
Re: php hesitates 5 seconds
Posted: Tue Apr 06, 2010 4:35 pm
by MAtkins
Technocrat-Evo thanks for the reply.
I set up 3 pages:
http://etracker.softlinksys.com/TestHtm.htm
http://etracker.softlinksys.com/TestNoPHP.php
http://etracker.softlinksys.com/TestWithPHP.php
The html comes up as normal.
Both of the php pages hesitate.
When I first download it I hold Ctrl down to insure a fresh copy.
I tried it holding Ctrl down and not, either way it takes about 5 to 7 seconds.
It's installed on a Windows 2003 box, IIS 5
I don't remember how I installed it.
Normally I'd use a Windows installer if available.
Normally I save my installation files too but apparently didn't this time.
I don't know how dangerous this is (maybe you could inform me?) but
http://etracker.softlinksys.com/PHPInfo.php
This should tell you everything about the installation.
Re: php hesitates 5 seconds
Posted: Tue Apr 06, 2010 5:21 pm
by Technocrat
Strange it acts like a compiler issue. Have you run PHP on this box before?
I might try to update to a 5.3 branch maybe. Perhaps its a bug with your install & windows.
Re: php hesitates 5 seconds - Technocrat-Evo ROCKS!
Posted: Fri Apr 09, 2010 3:30 pm
by MAtkins
Sorry this took so long - my multi-tasking skills are somewhat linear at times (ie not multi
THANK YOU Technocrat-Evo
I finally got a new install of php 5.3.2 and in the process saw an opportunity to use IIS 'FastCGI'.
It said I didn't have it so I googled it & found that it was a Microsoft installation.
I installed FastCGI into IIS 6 on my Windows Server 2003 box with very little pain.
I went back and did the install for php 5.3.2 and now my php pages are about as fast as I can expect with asp.net.
Thanks very much for your help.
I'm *really* looking forward to completely scrapping ASP.NET C# and MICROSOFT!!!