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

author author     2022-12-09     107

关键词:

<?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.');

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

】无法将WordPress备份从实时安装到本地【英文标题】:UnabletoinstallWordPressbackupfromlivetolocal【发布时间】:2018-11-2421:52:49【问题描述】:我已从实时WordPress站点备份并使用xampp在本地安装。设置db和WordPress文件后,我无法看到该网... 查看详情

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

】在mavenjetty7插件中启用调试日志记录【英文标题】:Enabledebuglogginginmavenjetty7plugin【发布时间】:2011-01-2306:43:45【问题描述】:我正在运行一个带有简单mvnjetty:run的javawebapp,使用最新的码头插件,但我似乎无法找到一种方法来... 查看详情

如何从 PHP 中的 Wordpress get_results 将数据添加到 OBJECT

】如何从PHP中的Wordpressget_results将数据添加到OBJECT【英文标题】:HowtoadddatatoOBJECTfromWordpressget_resultsinPHP【发布时间】:2016-06-3018:21:04【问题描述】:看起来很简单,但我似乎无法弄清楚......我有一个简单的行,可以像这样通过wor... 查看详情

将 Wordpress 从 MAMP 移动到 WAMP,无法访问页面

】将Wordpress从MAMP移动到WAMP,无法访问页面【英文标题】:MovingWordpressfromMAMPtoWAMP,can\'taccesspages【发布时间】:2015-08-1316:17:48【问题描述】:在我开始使用MAMP在我的本地网站上工作之前,我将Apache端口从8888更改为80,这是因为我... 查看详情

日志等级

...等级,从0到5总共6个等级:Trace=0这个级别只对开发人员调试有价值。这些消息可能包含敏感的应用程序数据,因此不应该在生产环境中启用。Debug=1对于在开发和调试过程中具有短期可用性的信息。如果不是出现问题在生产环境... 查看详情

将变量从 WordPress PHP 传递到 JavaScript

】将变量从WordPressPHP传递到JavaScript【英文标题】:PassingVariablefromWordPressPHPtoJavaScript【发布时间】:2018-01-2917:24:19【问题描述】:我正在使用两个WordPress插件-用于插入PHP代码的片段和用于插入JavaScript的脚本n样式。我的目标是获... 查看详情

将 PHP 变量从一个插件文件传递到另一个 WordPress

】将PHP变量从一个插件文件传递到另一个WordPress【英文标题】:PassPHPVariablesfromonepluginfiletoanotherWordPress【发布时间】:2012-07-1408:56:31【问题描述】:我正在开发一个WordPress插件,但遇到了一个小障碍。我正在编写与PayPal的IPN交互... 查看详情

Azure 远程调试:无法从 HRESULT 启用远程调试异常:0x89710023

】Azure远程调试:无法从HRESULT启用远程调试异常:0x89710023【英文标题】:AzureRemoteDebugging:FailedtoenableremotedebuggingExceptionfromHRESULT:0x89710023【发布时间】:2014-02-0621:55:59【问题描述】:我在尝试远程调试Azure网站时遇到一个奇怪的错... 查看详情

无法将javascript添加到wordpress中的divi页脚

】无法将javascript添加到wordpress中的divi页脚【英文标题】:Can\'taddjavascripttodivifooterinwordpress【发布时间】:2022-01-1721:33:06【问题描述】:我正在使用divi主题,并且在footer.php中运行了一行简单的javascript:<script>console.log("insideo... 查看详情

将 WordPress 从 WAMP 上传到 GoDaddy 时出现数据库错误(无法在本地访问站点)

】将WordPress从WAMP上传到GoDaddy时出现数据库错误(无法在本地访问站点)【英文标题】:DatabaseerrorwhenuploadingWordPressfromWAMPtoGoDaddy(cannotaccesssitelocally)【发布时间】:2016-10-2712:18:37【问题描述】:我绝不是任何专家,我真的希望这... 查看详情

尽管启用了本机代码调试,但仍无法从托管调试本机代码

】尽管启用了本机代码调试,但仍无法从托管调试本机代码【英文标题】:Unabletodebugnativecodefrommanageddespiteenablingnativecodedebugging【发布时间】:2020-06-2112:13:30【问题描述】:我有一个调用本机dll的托管项目(.net4.6.2)。如果我在本... 查看详情

使用 WordPress 将视频上传到 YouTube

】使用WordPress将视频上传到YouTube【英文标题】:UploadingvideostoYouTubeusingWordPress【发布时间】:2012-04-0701:44:35【问题描述】:我想允许我的网站访问者直接从我的WordPress网站前端将视频上传到我的YouTube频道。我尝试过使用PHPAPI,... 查看详情

php htaccess 忽略重复源无法启用

】phphtaccess忽略重复源无法启用【英文标题】:Phphtaccessignorerepatedsourcefailstoenabled【发布时间】:2014-09-0800:25:16【问题描述】:我正在设置我的htaccess并尝试从display_errors切换到log_errors..我让log_errors和error_log正常工作,所以现在我... 查看详情

无法从 ajax 调用中获取发布数据 - wordpress

】无法从ajax调用中获取发布数据-wordpress【英文标题】:Notabletogetpostdatafromajaxcall-wordpress【发布时间】:2016-04-1716:07:32【问题描述】:我有一个Ajax调用将更多帖子加载到页面上。一切正常,我从我拥有的模板中获取了HTML,但它... 查看详情

尝试从 ajax(Wordpress 插件)将 FormData 中的 Blob 发布到 php 时出现 400(错误请求)

】尝试从ajax(Wordpress插件)将FormData中的Blob发布到php时出现400(错误请求)【英文标题】:Getting400(BadRequest)whentryingtopostaBlobinFormDatatophpfromajax(WordpressPlugin)【发布时间】:2021-01-0722:11:53【问题描述】:所以请看下面的代码。constc... 查看详情

从 xcode 运行的 iOS 应用程序向我显示一条消息以启用调试日志记录

】从xcode运行的iOS应用程序向我显示一条消息以启用调试日志记录【英文标题】:iOSrunningappfromxcodeshowmeamessagetoenabledebuglogging【发布时间】:2016-01-1411:55:05【问题描述】:当我从xcode7启动我的应用程序时,我看到了这条消息2016-01-... 查看详情

无法将参数“日志”绑定到类型 TraceWriter

...发布时间】:2018-06-1613:31:06【问题描述】:右键项目->调试->启动新实例时得到以下消息。[1/7/20186:48:54AM]发生ScriptHost错误[1/7/20186:48:54AM]执行的HTTP请求:[1/7/20186:48:54AM]Mi 查看详情

如果没有启用远程调试器,React Native 代码将无法工作

】如果没有启用远程调试器,ReactNative代码将无法工作【英文标题】:ReactNativecodedoesn\'tworkwithoutRemoteDebuggerenabled【发布时间】:2017-06-1123:54:15【问题描述】:这是一个奇怪的问题,但由于我对此非常好奇,所以我想问一下。当我... 查看详情