zend header already send problem

吃可爱长大的小学妹 提交于 2020-01-06 12:45:48

问题


sometimes i got error when i include your class(AuthnetCim.class) in my controller. the error is as below:-

Fatal error: Uncaught exception ‘Zend_Controller_Response_Exception’ with message ‘Cannot send headers; headers already sent in /home/newwebsi/public_html/B4BPHP/public/include/AuthnetCIM.class.php, line 1′ in /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Response/Abstract.php:321 Stack trace: #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 in /home/newwebsi/public_html/B4BPHP/library/Zend/Controller/Response/Abstract.php on line 321

when i remove this class i do not get any error anywhere

Please, help me to resolve this error


回答1:


Make sure you do not have any characters before <?php in AuthnetCIM.class.php.




回答2:


Ouput is sent to the browser when the file AuthnetCIM.class.php is looked-up/included.

Check for spaces, BOM before the opening PHP tag, echoing/printing statements.

In other words check for anything that might be causing the script to output data.



来源:https://stackoverflow.com/questions/6045039/zend-header-already-send-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!