Re: ignore_repeated_errors has no effect
| From: | Simon Marchi | Date: | Sun, 07 Nov 2010 16:44:40 +0000 |
| Subject: | Re: ignore_repeated_errors has no effect | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309364@lists.php.net to get a copy of this message | ||
Hi,
Just a precision, I don't want to modify the user's code, I would like
to configure my server properly so it does not happen again even if
another user makes a similar mistake.
Thanks,
Simon
On Sun, Nov 7, 2010 at 09:02, Andre Polykanine <andre@oire.org> wrote:
> Hello Simon,
>
> Just modify the While statement:
> while(strlen(trim($ligne))==0 && file_exists($fic) && !feof($fic))
>
> --
> With best regards from Ukraine,
> Andre
> Skype: Francophile
> Twitter: http://twitter.com/m_elensule
> Facebook: http://facebook.com/menelion
>
> ----- Original message -----
> From: Simon Marchi <simon.marchi@polymtl.ca>
> To: php-general@lists.php.net <php-general@lists.php.net>
> Date: Sunday, November 7, 2010, 11:03:40 AM
> Subject: [PHP] ignore_repeated_errors has no effect
>
> Hi !
> My problem is the following. Due to crappy code by one of my users,
> PHP entered an infinite loop generating an error, causing very high
> load on the server and gigantic log files.
> The lines at fault were the following
>
> while(strlen(trim($ligne))==0 && !feof($fic))
> $ligne = fgets($fic,1024);
>
> where $fic is not a valid file resource. The generated error is an
> almost infinite amount of:
>
> [Fri Nov 05 03:28:33 2010] [error] [client 66.249.65.124] PHP Warning:
> feof() expects parameter 1 to be resource, boolean given in
> /home/comites/interne/polymond/nova_html/polysuisse2004/photo/gallerie.php
> on line 52
> [Fri Nov 05 03:28:33 2010] [error] [client 66.249.65.124] PHP Warning:
> fgets() expects parameter 1 to be resource, boolean given in
> /home/comites/interne/polymond/nova_html/polysuisse2004/photo/gallerie.php
> on line 53
>
> However, I did set ignore_repeated_errors to On, as well as
> ignore_repeated_source. I checked that the settings is effective in
> phpinfo().
>
> Does anybody have an idea why I still get these repeated errors ?
>
> Thanks !
>
> Simon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>