• Resolved iapprentice

    (@iapprentice)


    Hello,

    When I set define( ‘WP_DEBUG’, true ); in the wp-config.php The wordpress debug log is automatically displayed in the log monitor and the actual PHP Error log file is no longer displayed as an option in the setting tab.

    If I define( ‘WP_DEBUG’, false ); in the wp-config.php
    The PHP Error log file is correctly displayed in the PHP error log Field as a selectable option.

    This is occcuring on all sites that have DEBUG enabled in the wordpress config file.
    I am using Version: 1.1.1 on WordPress 5.6.2

    Thank you for your help.
    Best Regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author bestwebsoft

    (@bestwebsoft)

    Hi,

    Could you please try to add the following code in the ‘wp-config.php’ file:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_DISPLAY’, false );
    define( ‘WP_DEBUG_LOG’, true );

    See also:
    Debugging on WordPress – https://wordpress.org/support/article/debugging-in-wordpress/
    Editing wp-config.php – https://wordpress.org/support/article/editing-wp-config-php/

    Thread Starter iapprentice

    (@iapprentice)

    Hello,

    Thank you for the resonse. I already have those definitions in my wp-config.php file.

    I also have

    define( ‘WP_DEBUG_LOG’, ‘wp-errors.log’ );

    Thank you for your help.
    Best Regards

    Hi,

    Please try
    1) replacing:
    define (‘WP_DEBUG_LOG’, ‘wp-errors.log’);
    on
    define ('WP_DEBUG_LOG', dirname(__FILE__). '/wp-errors.log');
    2) create wp-errors.log file manually
    3) perhaps WordPress lacks file permissions. With your FTP program or through Сpanel go to the folder of your site and check the rights to the folders – 755 rights must be set, and 644 for all files.
    Here is the documentation – http://codex.wordpress.org/Changing_File_Permissions#Shared_Hosting_with_suexec

    Thread Starter iapprentice

    (@iapprentice)

    Hello,

    Thank you for the response.

    1.
    I changed the debug log filename define command as you suggested to the following.

    define (‘WP_DEBUG_LOG’, dirname(__FILE__). ‘/wp-errors.log’);

    It changed the debug file location from
    /mydomain/wp-content/debug.log
    to
    /mydomain/wp-errors.log

    However error log monitor plugin still displayed the wp-errors.log (debug log) as the PHP Error Log.

    This change did not fix the issue.

    2.
    I deleted the wordpress created debug.log and recreated it manually. It made no difference.

    3.
    I also checked File and Folder permissions they were already correct.

    Thank you for your help.
    Best Regards

    Thread Starter iapprentice

    (@iapprentice)

    I see that when WP_DEBUG_LOG is set to true, the PHP error_log filename is overwritten.

    From WordPress codebase

    if ( WP_DEBUG_LOG ) {
    ini_set( ‘log_errors’, 1 );
    ini_set( ‘error_log’, WP_CONTENT_DIR . ‘/debug.log’ );
    }

    I was not aware that this was taking place and that the ini_set definition takes precedence over error_log defines within php.ini or .user.ini.

    It’s clearly not an issue with your plugin.

    I am sorry that I have wasted your time. Thank you for your help.
    Best Regards

    • This reply was modified 3 years, 1 month ago by iapprentice.
    georgesupport

    (@georgesupport)

    Hi,

    Thank you for your reply. Glad that you have found the solution.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘No option to select the PHP Error log file when WordPress Debug enabled.’ is closed to new replies.