0

I am getting an error that prevents any logins This was previously working I believe and no longer does.

Please find below the code in the file the error message shows Reading the other answers to similar messages I see it mgith have been white space but there is none I don't think. I'm not really a coder just good at taking instructions but I can't see an end to the php so I checked other files in the same folder and none of them have it? There is not white space and I ran a grep -rl as mentioned but the other files don't seem to be it either. Any idea? I don't know how to find the whole error as mentioned either

I looked at the error report and it mentions this:

a:5:{i:0;s:153:"Cannot send headers; headers already sent in /home/yehaw598/public_html/app/code/local/Meigee/ThemeOptionsIndigo/controllers/LoginController.php, line 14";i:1;s:1371:"#0 /home/yehaw598/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)

<?php
/**
 * Magento
 *
 * @author    Meigeeteam http://www.meaigeeteam.com <nick@meaigeeteam.com>
 * @copyright Copyright (C) 2010 - 2012 Meigeeteam
 *
 */
class Meigee_ThemeOptionsIndigo_LoginController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        $this->loadLayout();
        echo Mage::app()->getLayout()->createBlock('customer/form_login')->setTemplate('customer/form/loginAjax.phtml')->toHtml();
    }
}

1 Answers1

0

Is it possible the file that is calling this has already output some data? Not too familiar with Magento inner workings, but my guess is another file has LoginController.php as an include, and that is the culprit that has already output the data. Try looking at the html source code to see what is actually appearing before the error message. Maybe there will be a hint (ie: error message, etc.)

If that doesn't work, I'd log into the server and try to find which file is including the loginconroller.php file and see what's in there. Something like this inside the document root would help to find the offending file, and give you a starting point:

grep -rl "LoginController.php" . 

Obviously this assumes some Linux derivation, if you're on windows, I'm sure there's a windows built-in search method for searching within a group of files for a particular string like "LoginController.php"

Once you identify the likely file, take a look above it for any html that may be outputting, or a php echo command, etc., maybe a line break at the top of that file ... you get the idea

Dale
  • 319
  • 2
  • 8
  • Thank you, but how do I do that grep thing? – Sarah-Taye Allen Nov 19 '14 at 18:29
  • log into your server via SSH assuming it's Linux, get to your document root. Depending on your host, you may automatically find yourself in your document root when you log in. Then simply run that command, it will give you a list of files that you can look in – Dale Nov 19 '14 at 18:58
  • It's only in the below: /app/code/local/Meigee/ThemeOptionsIndigo/controllers/LoginController.php ./app.zip ./help.php ./var/report/576483878871 ./var/report/355522042826 ./var/report/1111891491173 – Sarah-Taye Allen Nov 19 '14 at 19:16
  • The file the error is from, the file used to upload, the file I created a moment ago to output the other connected files and the three reports that show the error, Any other ideas? – Sarah-Taye Allen Nov 19 '14 at 19:17
  • According to your error message above, it looks like the culprit is: /home/yehaw598/public_html/lib/Zend/Controller/Response/Abstract.php on what I would guess is line 115 There's probably a white space in there somewhere, outside of the php tags – Dale Nov 19 '14 at 19:28
  • No, thats not it either, see below from line 113 - 125 public function setHeader($name, $value, $replace = false) { $this->canSendHeaders(true); $name = $this->_normalizeHeader($name); $value = (string) $value; if ($replace) { foreach ($this->_headers as $key => $header) { if ($name == $header['name']) { unset($this->_headers[$key]); } } } – Sarah-Taye Allen Nov 19 '14 at 19:34
  • Just for giggles, try changing Zend_Controller_Response_Abstract->canSendHeaders(true) from true to false on Abstract.php... – Dale Nov 19 '14 at 20:23