【问题标题】:zend header already send problemzend 标头已经发送问题
【发布时间】:2023-03-23 09:38:01
【问题描述】:

有时我在控制器中包含您的类(AuthnetCim.class)时出错。 错误如下:-

致命错误:未捕获的异常 ‘Zend_Controller_Response_Exception’ 带有消息“无法发送标头; 已经发送的标头 /home/newwebsi/public_html/B4BPHP/public/include/AuthnetCIM.class.php, 第 1 行 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Response/Abstract.php:321 堆栈跟踪:#0 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Response/Abstract.php(148): Zend_Controller_Response_Abstract->canSendHeaders(true) #1 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Action/Helper/Redirector.php(226): Zend_Controller_Response_Abstract->setRedirect('/B4BPHP/public/...', 第302章)#2 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Action/Helper/Redirector.php(370): Zend_Controller_Action_Helper_Redirector->_redirect('/B4BPHP/public/...') #3 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Action/Helper/Redirector.php(453): Zend_Controller_Action_Helper_Redirector->setGotoUrl('index/login', Array) #4 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Action.php(68 在 /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Response/Abstract.php 在第 321 行

当我删除这个类时,我在任何地方都没有收到任何错误

请帮我解决这个错误

【问题讨论】:

  • 确保 'error_display' 已关闭 :)

标签: zend-framework


【解决方案1】:

确保AuthnetCIM.class.php 中的<?php 之前没有任何字符。

【讨论】:

    【解决方案2】:

    在查找/包含文件 AuthnetCIM.class.php 时将输出发送到浏览器。

    检查空格、开始 PHP 标记之前的 BOM、回显/打印语句。

    换句话说,检查可能导致脚本输出数据的任何东西。

    【讨论】:

      猜你喜欢
      • 2014-11-08
      • 1970-01-01
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-14
      • 2019-11-08
      相关资源
      最近更新 更多