我正在努力使它能够输出到PHP中的控制台。我已经安装了FireFox和FireBug和FirePHP加载项。
我从FirePHPCore下载了‘这里服务器库’,并把它上传到‘wp/themes/Jupiter/include’(我的主题是木星)。
然后,在模板页的循环中,我编写了以下代码:
<?php
include_once('includes/FirePHPCore/FirePHP.class.php');
include_once('includes/FirePHPCore/fb.php');
ob_start();
FB::warn("Warning message!");
?>我尝试将包含放在functions.php中,我尝试使用OO/过程调用,但似乎没有任何东西起作用。我遗漏了什么?有更简单的方法吗?
我打开wp_debug是为了在尝试添加调试行时获得以下输出:
致命错误:在第32行的/home5/alumnicl/public_html/beta/main/wp-content/plugins/jupiter-framework/jupiter-framework.php中已经发送了消息头的异常“异常”。无法向FirePHP发送日志数据。您必须通过ob_start()或output_buffering ini目录启用输出缓冲。在/home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php:1178堆栈跟踪中:#0 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php(757):FirePHP->newException(‘Header已经.’) #1 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/fb.php(64):FirePHP->fb('hello‘),#2 /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/control-display.php(28):fb(数组,数组) #3 /home5/alumnicl/public_html/beta/main/wp-includes/template-loader.php(47):包括(‘/home5 5/alumnicl.’) #4 /home5/alumnicl/public_html/beta/main/wp-blog-header.php(16):require_once('/ho in /home5/alumnicl/public_html/beta/main/wp-content/themes/Jupiter/includes/FirePHPCore/FirePHP.class.php,第1178行)
我已经在require语句之前直接包含了ob_start() --我应该把它放在其他地方吗?
发布于 2013-04-09 04:48:28
我使用它包括文件(匹配您的实际文件位置):
require '../../FirePHPCore/fb.php';
然后通过使用
fb( $variable, 'Message Title');确保您已经在火狐上安装和激活了FirePHP副词。
还有一个用于WordPress的FirePHP插件,但我从未使用过它。
发布于 2013-04-18 06:37:42
正如RRikesh所说的,您需要在将任何HTML发送到客户端之前将包含和缓冲区语句放在一起。换句话说,这可能需要放在header.php文件的顶部。
https://wordpress.stackexchange.com/questions/95099
复制相似问题