tags:

views:

211

answers:

1

Hello all,

I've installed AjaXplorer (very nice web file explorer), written in PHP, on my IIS (Windows Server 2008 SP2 x64). It works too slow for me.

What can be the cause? Are there some settings in php.ini? Or, maybe, something is wrong with IIS?

I use 32-bit PHP, php-cgi.exe as interpreter.

Regards,

+1  A: 

First off, CGI will always be slow. It needs to boot the entire PHP runtime for each request. Try using FastCGI (If you're using IIS 7, or if you're using IIS 6)...

After that, try to see why it's slow. Is it because the PHP script takes a long time to execute (meaning it's a code issue), or is it because of a server config. To test, modify this into the start of the entrance point of the PHP program (index.php):

define(START_TIME_CUSTOM, microtime(true));
function onEndTimeCompute() {
    $timeTaken = microtime(true) - START_TIME_CUSTOM;
    echo "Completed In: ".number_format($timeTaken, 4)." Seconds\n";
}
register_shutdown_function('onEndTimeCompute');

That write Completed in n Seconds to the end of the generated output (even if die() is called). It may cause some issues if Ajax calls are expected to return JSON, so don't do it as a rule, just for trying to figure out what's going on.

So, if the total request takes 1 second, yet you see Completed in 0.004 Seconds, you know that the PHP code itself is not the issue (it's either in the setup of the interpreter by CGI, or somewhere else in IIS)...

That should at least show you where the problem is...

ircmaxell
Thank you, ircmaxell!
noober