Huge debug.log because of "undefined offset in media.php"

Recently debug.log (WP 5.3.2) grew to 17GB because of tons of entries like this:[17-Jan-2020 16:29:01 UTC] PHP Notice:

Recently debug.log (WP 5.3.2) grew to 17GB because of tons of entries like this:

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 790

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 0 in /wp-includes/media.php on line 69

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 70

What would be an efficient way to find out what exactly causes these notices?

Recently debug.log (WP 5.3.2) grew to 17GB because of tons of entries like this:

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 790

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 0 in /wp-includes/media.php on line 69

[17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 70

What would be an efficient way to find out what exactly causes these notices?

Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Jan 17, 2020 at 16:59 chrischris 1195 bronze badges 3
  • 1 Try disabling plugins and/or changing theme. One of them is passing incorrect $size array when calling functions in media.php. – Vitauts Stočka Commented Jan 21, 2020 at 16:27
  • 1 You can also check for empty $size arrays at those places and log the wp_debug_backtrace_summary to see where the bad calls came from. – Rup Commented Jan 21, 2020 at 23:34
  • It was a plugin misbehaving indeed... problem solved. With thanks. – chris Commented Jan 22, 2020 at 15:35
Add a comment  | 

1 Answer 1

Reset to default 1

I know it was mentioned in the comments that you solved this by locating the offending plugin. However, I thought the following answer may be helpful for others if they happen along this in a search.

Here's a little code snippet that can be used to save the debug log file by date:

ini_set( 'error_log', WP_CONTENT_DIR . '/debug-' . date('Y-m-d') . '.log' );

Using this method, you can prevent the file from just growing (it will set a new one each day).

Obviously, you want to track down the real problem so the debug log doesn't grow infinitely. But using something like this can buy some time to help during the process.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744772140a4592823.html

相关推荐

  • Huge debug.log because of "undefined offset in media.php"

    Recently debug.log (WP 5.3.2) grew to 17GB because of tons of entries like this:[17-Jan-2020 16:29:01 UTC] PHP Notice:

    16小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信