Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm a bit of nube when it comes to configuring IIS 7.5 and Php so apologies if this is a silly question but I've been wrestling with this for over half the day and need some fresh input.

I have a php application running on IIS 7.5 , php 5.4 running as fastcgi. The application works absolutley fine with the exception that long running php scripts seem to hang; no 500 error they simply seem never complete and return the results to the browser.

I've written a simple test script below to eliminate the possibility of programming error in the main app :

<?php
/* test timeout */
/*set_time_limit(110);*/
echo "Testing time out in seconds\n";
for ($i = 0; $i < 175; $i++) {
    echo $i." -- ";

    if(sleep(1)!=0)
    {
        echo "sleep failed script terminating"; 
        break;
    }
}

?>

If I run the script beyond 175 seconds it hangs. Below that it will return the results to the browser.

Here are the time out parameters that I've set for php and fastcgi. I've also played around setting these really low in order to get various time out errors and have succeeded which brings me to the conclusion that there's another setting that I'm missing .. perhaps.

fastcgi

activity timeout=800 Idle Timeout = 900 request Timeout 800

Php

max_execution_time=700

Any solutions or pointers in the right direction would be very ... very welcome.

Thanks

share|improve this question
add comment

1 Answer

It's been a long time since I've dealt with it, but you need to increase the CGI timeouts in IIS as it will simply kill the PHP process if it runs too long.

share|improve this answer
    
Thanks Sammitch I'll give it a go and report back. –  Rich Nov 23 '12 at 0:37
    
Just checked the default cgi timeout and it's set to 15 minutes which is way over whats needed. I'm trying to get it to not fail above 175 seconds at the moment. –  Rich Nov 23 '12 at 0:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.