![](/img/trans.png)
[英]WordPress: PHP warnings and notices shown even with WP_DEBUG and WP_DEBUG_DISPLAY consts set to false
[英]Display (errors, warnings, notices) of `define( 'WP_DEBUG', true );` in Wordpress
可以在console.log()
顯示define( 'WP_DEBUG', true );
的結果(錯誤,警告,注意define( 'WP_DEBUG', true );
?
您可以在php中添加錯誤轉儲,結果將包括所有錯誤和警告
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
在index.php
文件的頂部添加此行
注意:僅用於開發
是的@ cabrerahector
好了,您可以使用一些PHP和AJAX讀取debug.log文件的內容,然后通過console.log()輸出。
要在頁面上顯示錯誤,警告和注意,請通過php.ini啟用php錯誤日志,或在第一個php調用文件頂部使用以下php代碼。
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.