php 将WordPress调试日志启用到无法从Web访问的专用文件夹。有关详细信息,请参见http://wordpress.stackexchange.com/q/84132/24260

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 将WordPress调试日志启用到无法从Web访问的专用文件夹。有关详细信息,请参见http://wordpress.stackexchange.com/q/84132/24260相关的知识,希望对你有一定的参考价值。

<?php
/*
Plugin Name: Private Debug Log
Description: Enable debug log to a private folder not accessible from the web
Version: 0.0.1
Author: WebAware
Author URI: http://www.webaware.com.au/
*/

/*
copyright (c) 2013 WebAware Pty Ltd (email : rmckay@webaware.com.au)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

/*
INSTRUCTIONS:
=============

Edit the location of $debuglog to specify a folder outside your website root, inaccessible to web browsers.
Some common folder names are 'private', '_private', 'tmp'
*/

// for testing, will put debug log in folder wp-content/uploads
//~ $debuglog = WP_CONTENT_DIR . '/uploads';

// put debug log in folder ../private (i.e. outside the web root)
$debuglog = dirname(ABSPATH)  . '/private';

ini_set('log_errors', 1);
ini_set('error_log', $debuglog . '/debug.log');

error_log(basename(__FILE__) . ': if you can read this, close enough.');

以上是关于php 将WordPress调试日志启用到无法从Web访问的专用文件夹。有关详细信息,请参见http://wordpress.stackexchange.com/q/84132/24260的主要内容,如果未能解决你的问题,请参考以下文章

如何在电脑中将日志一般状态改成调试状态

WordPress调试

在 maven jetty 7 插件中启用调试日志记录

在标题(php)中启用CORS不能在wordpress网站上运行[重复]

php 将一些参数过滤到WordPress YouTube oEmbed请求中。启用适度品牌,隐藏YouTube徽标。删除视频标题

无法将 WordPress 备份从实时安装到本地