Menu

#26 click.php: fopen warning

open-postponed
nobody
None
5
2010-08-24
2010-08-24
Anonymous
No

In click.php the first fopen() call which tries to open a log file for append, generates a warning if the directory doesn't exist:

httpd: PHP Warning: fopen(<local path censored>/clickheat/logs/<my page title censored>/2010-08-24.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <local path censored>/clickheat/click.php on line 95

Since click.php checks via is_resource() if everything worked out as expected, it's probably enough to add a @-sign as prefix to "mute" the generated warning. I've attached a patch against the 1.10 release which includes the "be nice to your error log fix".

Discussion

  • Anonymous

    Anonymous - 2010-08-24

    Maybe I should note that I use the "per page" click statistics instead of the grouped results. Therefor, the directory name in which the log is placed is always the title/name of a subpage.

     

    Last edit: Anonymous 2016-01-03
  • Blade 1o6

    Blade 1o6 - 2010-08-24

    Hello,

    I won't fix this, as it's a performance issue to use @ prefix. The fact that the error happens it most of the time not a real issue, as almost no one reads their error logs (too bad...).

    The only patch that could be used is a try/catch, as this will not output the error. May be I should fix this that way.

     
  • Blade 1o6

    Blade 1o6 - 2010-08-24
    • status: open --> open-postponed
     

Log in to post a comment.

MongoDB Logo MongoDB