شرح تفعيل مود ( wp_debug ) في الوردبرس wordpress
للكشف عن اخطاء الموقع
Enable PHP Debugging
تفعيل مشاهدة الاخطاء على صفحة الموقع
افتح الملف wp-config.php ثم ستجد هذا السطر
كود:
define( ‘WP_DEBUG’, false );
اجعله True فقط وسيظهر الخطا ان وجد على صفحة الموقع الرئيسية
تفعيل مشاهدة الاخطاء على ملف منفصل
ضع هذا السطر اسفل السطر السابق
كود:
define( ‘WP_DEBUG_LOG’, true );
وستجد النتيجة فى ملف فى المسار /wp-content/debug.log
الاكواد كلها مجمعه
كود:
define('WP_DEBUG', true); |
// Tell WordPress to log everything to /wp-content/debug.log |
define('WP_DEBUG_LOG', true); |
// Turn off the display of error messages on your site |
define('WP_DEBUG_DISPLAY', false); |
// hide errors from being displayed on-screen |
@ini_set('display_errors', 0);
-------------------------------------------------------------------------------------------------
How to turn on WordPress debug mode using cpanel ( wp_debug )
To check your wordpress error log do this you must turn on debugging in your wordpress config file.
Do this from a FTP Browser or hosting panel. Find a file called wp-config.php this will be in the base of your wordpress installation.
Look for this section near the button:
* Change this to
true to enable the display of notices during development.
كود:
define('WP_DEBUG', false);
If you want wordpress to send debugging information to a file called debug.log
put this code also
كود:
define('WP_DEBUG_LOG', true);
the result will be in [root wordpress foler]/wp-content/debug.log
Log viewer plugin
https://wordpress.org/plugins/log-viewer/
To view the debug log from your admin panel you can installed the plugin
log viewer.
Then you can see your log by going to tools > log viewer. But you still need to enable logging to use this plugin.
After you have set debugging to true and you have run the scenario that creates the problem, if the plugin states no file or the debug.log has not been created then there was no WordPress error to log.
If there are errors in this file, please send me a copy to debug.
php error log
If there are no errors in your debug.log then is best to then check your php error log.
You can find it in the root of your wordpress installation, it will be called error_log.
المفضلات