2012-09-14 74 views
4

我的問題是,使用備份夥伴將網站遷移到另一臺服務器後,我遇到了死亡的白屏。Wordpress難以追蹤的移民死亡白屏

我在Wordpress中打開調試模式,仍然沒有錯誤,只是白色的屏幕。

所以我嘗試刪除所有的文件,並重新上傳他們,並保持原樣(由BackupBuddy導入的),但它仍然給我白色的屏幕。

所以我試圖跟蹤發生白屏的特定行,並陷入了一個奇怪的行爲。

在/wp-content/plugins/woocommerce/widgets/widget-init.php:

include_once('widget-cart.php'); 
include_once('widget-featured_products.php'); 
include_once('widget-layered_nav.php'); 
include_once('widget-price_filter.php'); 
include_once('widget-product_categories.php'); 
include_once('widget-product_search.php'); 
include_once('widget-product_tag_cloud.php'); 
include_once('widget-recent_products.php'); 
include_once('widget-top_rated_products.php'); 
  1. 當添加一個 「管芯( '潮');」之前 「include_once('widget-price_filter.php');」 =繁榮打印出來。
  2. 當我添加一個「死('繁榮');」 「include_once('widget-price_filter.php');」 =繁榮不打印 了。

所以可以肯定的說這個bug是在widget-price_filter.php裏面的嗎?

問題是,當我在widget-price_filter.php的開頭添加一個die時,它不打印出來。這就像錯誤發生的路線是無處可去的。

這可能是什麼原因造成的?

+1

錯誤日誌文件呢?你有檢查嗎? – ariefbayu

回答

5

So it's safe to say that the bug is inside widget-price_filter.php right?

是的,完全(你遵循正確的調試方式)。

The problem is when I add a die at the beginning of widget-price_filter.php, it does not print it out. It's like the line where the error occurred is nowhere.

如果(像你說你做),你就在頂部(在<?php後)加入die('HELLO');,並沒有出現 - 這意味着有兩個問題

  1. 一個未找到文件
  2. 該頁面中的語法錯誤。

您可以通過三種1的方式解決:

  1. 檢查PHP錯誤日誌(如果你有機會)
  2. 之前所說的 「include_one」(中的init.php)添加:

    error_reporting(E_ALL); 
    ini_set('display_errors', 'on'); 
    
  3. 完全空的代碼(只是離開<?php die('HELLO'); ?>,檢查顯示,然後在一點一點添加代碼

如果你有第2條路線,記得在你的路線工作時把它拿出來。很重要!

+1在發佈之前實際需要時間嘗試自己解決它(使用echo和die)。所以我希望這對其他人有所幫助。

+2

有沒有錯誤日誌sk我試過#2,我得到這個錯誤: 致命錯誤:允許的內存大小33554432字節用盡(試圖分配122880字節)在/ home/buyrings/public_html/wp-content/plugins /woocommerce/widgets/widget-price_filter.php 170行 謝謝!我終於可以繼續進行調試了。 – thedjaney

+0

不客氣 - 很高興它幫助和祝你好運。 – Robbie