【发布时间】:2014-06-30 05:10:49
【问题描述】:
几天前,我在尝试登录时遇到了这个错误
我确实找到了一些解决方案,例如:
- 重命名插件文件夹
- 替换出现错误的文件。
但在这种情况下这些都不起作用,仍然存在问题,因此我们将不胜感激。
错误:
ERROR: Cookies are blocked due to unexpected output.
这是服务器错误日志:
[10-May-2014 14:02:28 UTC] PHP Notice: Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 115
[10-May-2014 14:02:28 UTC] PHP Notice: Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 118
[10-May-2014 14:02:28 UTC] PHP Notice: Use of undefined constant WP_TEMPLATE_URL - assumed 'WP_TEMPLATE_URL' in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 119
[10-May-2014 14:02:28 UTC] PHP Notice: Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 189
[10-May-2014 14:02:28 UTC] PHP Notice: Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 202
[10-May-2014 14:02:28 UTC] PHP Notice: Undefined index: __getthere in /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php on line 213
[10-May-2014 14:02:28 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php:115) in /home/paragint/public_html/wp-login.php on line 414
[10-May-2014 14:02:28 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/paragint/public_html/wp-content/themes/RockStarLeadTheme-v2-4/functions/mobile/index.php:115) in /home/paragint/public_html/wp-login.php on line 426
更新: 这个问题基本上是由于文件编码 UTF-8 BOM 而不是 WordPress 3.9 中通常的 UTF-8 而发生的,但是知道如何摆脱它吗?因为保存文件不适合我。
【问题讨论】:
-
输入>处理>输出。您的主题不会使用这些步骤。在
functions.php的第一行添加ob_start();(这不是最佳做法),或通过以下规则解决问题:data input > data handling > print out the result -
@AdrianPreuss 我不确定你想建议什么。
-
这就是编程的基础:数据输入 > 数据处理 > 输出,IPO 模型:en.wikipedia.org/wiki/IPO_Model