Support » Plugin: Error Log Monitor » "The log file /htdocs/logs/php-errors.log does not exist or is inaccessible."

  • Resolved Goforich

    (@goforich)


    Please Help
    I have put
    ini_set(‘log_errors’, ‘On’);
    ini_set(‘error_log’, ‘/htdocs/logs/php-errors.log’);
    in my wp-config.php file and saved it.

    (the full path is: humanbottleneck.com/htdocs/logs/php-errors.log)

    I have set uo a directory “logs” under htdocs, saved a file php-errors.log and set its permissions to 664

    It still does not run. Any suggestions?
    Richard

    https://wordpress.org/plugins/error-log-monitor/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Goforich

    (@goforich)

    I may have got it working now,
    Used filepath derived from error report:
    /home/linweb25/h/humanbottleneck.com/user/htdocs/logs/php-errors.log
    Now it just says log file is empty, so now waiting for errors!

    Richard

    Plugin Author Janis Elsts

    (@whiteshadow)

    All right, good to hear you figured it out. You’re right – you need to use the *full* path. A path that’s relative to your home directory/site will not work.

    Goforich

    (@goforich)

    Janos,
    Where would I usually go to find the full path?

    I only came across it by accident while delving into some other log files on the site.
    The “/home/linweb25/h” part was new to me and unexpected.
    “log file empty” still, is there any simple way to create an error to test it?

    Richard

    Plugin Author Janis Elsts

    (@whiteshadow)

    Sorry, I don’t really have an answer to that. It depends entirely on how your server is set up.

    I guess you could always ask your host what the absolute path of your home directory is. Some hosts also display the path in their control panel. For example, here’s how you can find it on GoDaddy:
    https://www.godaddy.com/help/find-your-absolute-path-58

    Goforich

    (@goforich)

    I am now unsure if it is working as it still just says log file is empty, yet I can see from the “error_log” file in the same logfiles directory, that I have had a dozen or so errors in the last few days.

    Plugin Author Janis Elsts

    (@whiteshadow)

    Could those be errors that happen before/outside WordPress? Since the ini_set('error_log', ...) code is in wp-config.php, any errors that happen before wp-config.php is loaded will be written to whatever log file the server is using by default, not the file that you created.

    If you like, you could always change the wp-config.php code to point to the “error_log” file instead of “php-errors.log”.

    Goforich

    (@goforich)

    Thanks Janis. Interesting thought.
    Below are the last few errors listed in error_log, can you tell me if they look like errors “that happen before/outside WordPress”? This world is unfamiliar to me!

    cheers
    richard

    [Sat Oct 17 23:46:48 2015] [error] [client 81.174.135.228] Premature end of script headers: php54-cgi, referer: http://www.humanbottleneck.com/wp-admin/index.php
    [Sat Oct 17 23:47:04 2015] [warn] mod_fcgid: read data timeout in 60 seconds
    [Sat Oct 17 23:47:04 2015] [error] [client 192.0.84.33] Premature end of script headers: php54-cgi
    [Sat Oct 17 23:52:15 2015] [warn] mod_fcgid: read data timeout in 60 seconds
    [Sat Oct 17 23:52:15 2015] [error] [client 81.174.135.228] Premature end of script headers: php54-cgi, referer: http://www.humanbottleneck.com/wp-admin/index.php
    [Sun Oct 18 23:46:51 2015] [warn] mod_fcgid: read data timeout in 60 seconds

    Plugin Author Janis Elsts

    (@whiteshadow)

    Those are not PHP errors, so it makes sense that they would not show up in the PHP error log.

    As you probably know, a web sever often has a bunch of different log files. The messages you posted look like they’re from the Apache error log. PHP errors often (but not always) go in a different log file.

    Goforich

    (@goforich)

    Thanks Janis

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘"The log file /htdocs/logs/php-errors.log does not exist or is inaccessible."’ is closed to new replies.