2017-09-03 76 views
1

我面對下面的錯誤在我的WordPress網站WordPress的PHP的警告:使用simplexml_load_file()

[03-Sep-2017 10:12:36 UTC] PHP Warning: simplexml_load_file(): in /home/syriacar/public_html/syria-cart.com/wp-content/plugins/polylang/modules/wpml/wpml-config.php on line 53 

這裏是文件出錯的內容

foreach ($plugins as $plugin) { 
     if (file_exists($file = WP_PLUGIN_DIR . '/' . dirname($plugin) . '/wpml-config.xml') && false !== $xml = simplexml_load_file($file)) { 
      $this->xmls[ dirname($plugin) ] = $xml; 
    } 
    } 
+1

你可以發佈'wpml-config.xml'文件的內容嗎? – Matthew

+0

這裏是: \t <定製的類型> \t \t <定製型翻譯= 「1」>項目 \t \t \t \t <鍵名= 「mh_mharty」> \t \t \t <鍵名= 「mharty_date_format」/> \t \t \t <鍵名= 「mharty_seo_home_titletext」/> \t \t \t <鍵名=「MH arty_seo_home_descriptiontext」 /> \t \t \t <鍵名= 「mharty_seo_home_keywordstext」/> \t \t \t

回答

2

這可能是由於畸形WPML -config.xml文件。

例如,在this支持WordPress論壇頁面,可以找到類似的問題,原因是缺少</key>,結束標記</admin-texts>之前。

UPDATE:

在你的意見,你還別說yith-woocommerce-AF filiates警告,所以另一種可能性是,YITH WooCommerce附屬插件沒有WPML-config.xml中或者是空。

polylang documentation約WPML-config.xml中提到了以下幾點:

Developpers必須將WPML-config.xml文件的根目錄下的插件或主題的 。

+0

我看着它,但一切看起來不錯 –

+0

是的,我已經看到你的XML文件,看起來不錯。是警告「[03-Sep-2017 10:12:36 UTC] PHP警告:」只警告關於simplexml_load_file()或在那個警告之前或之後有其他人嗎? – user8230352

+0

實際上他們有三個:'[03-Sep-2017 20:19:47 UTC] PHP警告:simplexml_load_file():/home/syriacar/public_html/syria-cart.com/wp-content/plugins/yith -woocommerce-affiliates/wpml-config.xml:1:解析器錯誤:文檔在/home/syriacar/public_html/syria-cart.com/wp-content/plugins/polylang/modules/wpml/wpml-config.php中爲空在線53 [03-Sep-2017 20:19:48 UTC] PHP警告:simplexml_load_file():在/home/syriacar/public_html/syria-cart.com/wp-content/plugins/polylang/modules/wpml/ wpml-config.php 53行 ' –