2012-12-21 79 views
0

可能重複:
Cannot modify header information - headers already sent, Why its happening
Headers already sent by PHP警告:WordPress的儀表板在session_start()[function.session開始]錯誤

我得到了我的WordPress的儀表板下面的錯誤信息。

警告:在session_start()[function.session啓動]:無法發送會話緩存限制器 - 已經發送了頭(輸出開始/homez.152/mamouman/www/wp-content/themes/arthur/functions .PHP:47)在上線/homez.152/mamouman/www/wp-content/themes/modularity/functions/admin-js.php 2`

這裏是我剛剛添加的內容我functions.php文件

add_filter('wp_nav_menu_items','add_search_box', 10, 2); 
function add_search_box($items, $args) { 

    ob_start(); 
    get_search_form(); 
    $searchform = ob_get_contents(); 
    ob_end_clean(); 

    $items .= '<li>' . $searchform . '</li>'; 
return $items; 
} 

這裏是my admin-js.php

+0

您無法鏈接到直接託管的PHP文件,我們無法看到它的源代碼。 – kennypu

+0

感謝kennypu,好吧,我已經將URL更改爲臨時上傳。 –

回答

0

該問題很容易解決: ?>在functions.php有一個空格在其結尾。

+1

離開(文件結尾的最後一個關閉'?>'),這不會發生。這是一個典型的錯誤。請參閱[PHP關閉標籤](http://stackoverflow.com/questions/4410704/php-closing-tag)和[爲什麼有些腳本省略了關閉php標記?>''?](http://stackoverflow.com/q /367456分之3219383) – hakre

相關問題