views:

46

answers:

1

The simplest script:

<?php echo 'hello';

Takes about 3 seconds to execute. There seems to be a big time interval Apache waits until it serves a web page.

I tried turning off antivirus, disabling ipv6 and more but Apache is still very slow. What should I do?

EDIT:

Additional information:

  • Apache 2.2
  • PHP 5.2
  • It's only dynamic PHP files. Static files (html) are served instantly
  • It has nothing to do with system specs, it's new PC

There are few PHP notices in Apache error log:

[Thu Jul 01 08:37:21 2010] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: ref in D:\\data\\o\\WebProjects\\elearning\\application\\modules\\clientarea\\controllers\\ViewController.php on line 578, referer: http://elearning/clientarea/view/course/teid/1/cid/1
A: 

Use the Task Manager to kill unnecessary processes.

By the way, you should end your script with ?>.

mcandre
@mcandre A trailing ?> is unnecessary (though some people might argue over whether or not it's good practise) and can actually cause problems in some cases if there are spaces after the ?> So I prefer not to have it
Mark Baker
Not to be 'one of those guys', but leaving off the ?> is acceptable and actually recommended by a number of coding standards. For one, it ensures no trailing whitespace ends up pushing output before headers, for example.
Narcissus
@Narcissus I Agree too!
Codex73