doushi1996 2017-05-29 20:44
浏览 49

无法修改标头信息 - WSOD

wp-admin or dashboard wsod

Website looks fine, only dashboard wsod.

Set WP_DEBUG to true.

No errors displayed.

Then I added no-white-screen.php in mu-plugins as ref. suggested.

These are my errors:

Cannot modify header information - headers already sent by (output started at /home/content/58/11808258/html/FFG/wp-includes/pomo/mo.php:2) Backtrace from warning In /home/content/58/11808258/html/FFG/wp-includes/functions.php [line 1141]:
[line ?] calling process_error() /home/content/58/11808258/html/FFG/wp-includes/functions.php [line 1141] calling header_remove() /home/content/58/11808258/html/FFG/wp-admin/admin.php [line 33] calling nocache_headers() /home/content/58/11808258/html/FFG/wp-admin/index.php [line 10] calling require_once()

There are more similar errors but I won't add these, I don't want to spam.

I haven't added any new plugins or done any theme changes, I've anyways deactivated them (by renaming ftp folders) and the problem persisted.

This is the section of function.php that is reporting the errors:

    function nocache_headers() {
    $headers = wp_get_nocache_headers();
    unset( $headers['Last-Modified'] );
    // In PHP 5.3+, make sure we are not sending a Last-Modified header.
    if ( function_exists( 'header_remove' ) ) {
        @header_remove( 'Last-Modified' );
    } else {
        // In PHP 5.2, send an empty Last-Modified header, but only as a
        // last resort to override a header already sent. #WP23021
        foreach ( headers_list() as $header ) {
            if ( 0 === stripos( $header, 'Last-Modified' ) ) {
                $headers['Last-Modified'] = '';
                break;
            }
        }
    }
    foreach ( $headers as $name => $field_value )
        @header("{$name}: {$field_value}");
}

The 'errors' are produced by these 2 lines

@header("{$name}: {$field_value}"); 

and

@header_remove( 'Last-Modified' );

Any help greatly appreciated!

  • 写回答

1条回答 默认 最新

  • doushi3454 2017-05-29 21:14
    关注

    This error suggests that some code is outputing content before the page is complete. This is often brought about by an echo throwing out text or other page components during the wrong part of the WordPress cycle (eg during a background operation / hook).

    This is quite a generic error at this stage so you'll need to identify the cause of the issue via a process of elimination. You can start by doing the following:

    1. Rename your plugins folder, so as to ensure all plugins are 100% disabled. Rename wp-content/plugins to 'wp-content/plugins-x' or something similar.

    If this restores admin/dashboard access, you can rename the plugin folder and then re-activate plugins one by one until the error returns. At this point, you'll know which plugin is the cause.

    If that doesn't get you back into admin you may need to do a similar things with the themes folder.

    1. If that doesn't get you back into admin you may need to do a similar things with the themes folder. If renaming plugins fixes it, then you know it's a plugin causing the issue. Otherwise, it would suggest some bad code in your theme.

    If renaming plugins fixes it, then you know it's a plugin causing the issue. Otherwise, it would suggest some bad code in your theme. I'd recommend checking the functions.php file first as this is where most tinkering usually takes place.

    In particular, carefully examing any code you might have added or customised.

    If you have access to server logs, take a look at these as they should provide more precise info as to the source or at least the point when the issue occurrs.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line