Home > Server Error > Php Error 500 Timeout

Php Error 500 Timeout


The Code class MyClass { private $max_time; public $result; public function myFunc() { sleep (1); if (time() > $this->max_time) $this->result = "Timed out"; else $this->myFunc(); return $this->result; } function __construct() { But I hoped that there would be some kind of parallel processing of the Ajax requests that would keep things moving along. Avoiding 500 Internal Server Error Timeout in PHP Published: 8th Feb 2015 I found that this error was due to an infinite/deeply-nested loop in my code. Well, I was testing on my local host server where it did not seem to continue beyond the first 500 error.

Are there any specific logs or settings for this protocol? But alas it was not the case in my test server (WAMP) environment. I'm looking for possible solutions or ideas to further investigate the problem (like some tips about logs to check). WouterRonline, Jun 3, 2012 #2 WouterRonline Kilo Poster Messages: 12 Nobody has any idea?

Http Error 500 Wordpress

WouterRonline Kilo Poster Messages: 12 Hi everybody, I have the following problem: PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE Plesk 9.5.5 Windows 2008 Server (web edition) PHP safe mode: off PHP max_execution_time: 30 Also, this message always appears after about 40 secondes. So it has something to do with FastCGI. Also, after putting set_time_limit(3600); into the code this same results happen.

WouterRonline, Jun 5, 2012 #3 To get around this 500 Internal Server Error Timeout in PHP we can build into our recursive function a timer that triggers a break from the loop just short of the You can extend the timeout via code, but I think it is a bad idea unless the code is running in the background and you have another mechanism to break out 500 Internal Server Error Iis With set_time_limit: The full script runs with a max of the number of seconds set in the set_time_limit ANY ADDITIONAL INFORMATION I tried several things, but nothing seems to work.

We may have a recursive function (one that calls itself) that takes too long to complete (usually > 30s) and the sever maximum execution time is hit. And if you are on a shared hosting plan, it could get your account suspended if your script consumes excessive server resources. © 2016 Backend Coder Log in WouterRonline, Jun 3, 2012 #1 WouterRonline Kilo Poster Messages: 12 Additional note: when switching from FastCGI to CGI, the problem is solved. get redirected here ACTUAL RESULT Both with and without the set_time_limit code: After about 40 seconds a 500 internal server error appears EXPECTED RESULT Without set_time_limit: After 30 seconds a message will appear saying