[wp-trac] [WordPress Trac] #47985: Site Health: log errors to public file

WordPress Trac noreply at wordpress.org
Fri Dec 13 09:54:48 UTC 2019


#47985: Site Health: log errors to public file
------------------------------------+---------------------
 Reporter:  afragen                 |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  5.4
Component:  Site Health             |     Version:  5.2
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------

Comment (by kubiq):

 We should check it with CURL if that file is really public.
 For example, in all my WP installations I have enabled WP_DEBUG_LOG and I
 placed there also .htaccess file with this content:

 {{{
 RemoveHandler .log
 RemoveType .log

 <Files *.log>
         order deny,allow
         deny from all
 </Files>
 }}}

 So debug.log is definitely not public, it can be accessed only by FTP, but
 there is still this "critical issue" and some clients are worried about
 it.

 Workaround should be like firstly write something to that log, so we make
 sure, file exists:
 {{{#!php
 <?php error_log('Testing debug.log'); ?>
 }}}


 Then just use one of PHP functions to return response headers, like
 file_get_contents or CURL or others... and check if the response code is
 200

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47985#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list