Вопрос

Oops. I have been trying to play around with some PayPal code and have inadvertently set an infinite loop of some sort going on my server. Any guidance on how to stop this code running would be much appreciated. The error log is quickly building up, every error is the same as follows:

PHP Warning:  feof() expects parameter 1 to be resource, boolean given in /home/myfirsti/public_html/work.php on line 3
[04-Jul-2013 00:44:38 Europe/London] PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /home/myfirsti/public_html/work.php on line 4

Many thanks.

Это было полезно?

Решение

It should stop when the execution time limit is reached, which is usually just a minute. However note that this time does not include file I/O, so the amount of time it takes to write the error log may be extending the length of the script.

It will stop eventually, but you should contact your host and ask them to kill the process.

To prevent it happening in future, always check if the resource is valid before passing it to feof()

(Note that I really wish the function were fneof instead "file not end of file" to prevent this kind of problem...)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top