Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    56
    Plugin Contributions
    0

    Default Blank page - Cannot modify header information - headers already sent error

    Hi All,

    I am running Zencart 1.5.4 with the Winchester responsive template. It has been working fine for a while, but today I started getting a blank page on logging in, logging out or adding something to the cart.

    I get these messages in the error logs (logs folder):

    [11-Jul-2015 21:18:22] PHP Warning: Cannot modify header information - headers already sent by (output started at /usr/local/pem/vhosts/301425/webspace/httpdocs/gifts4baby.ie/includes/languages/english/extra_definitions/winchester_responsive/winchester_responsive_defines.php:1) in /usr/local/pem/vhosts/301425/webspace/httpdocs/gifts4baby.ie/includes/functions/functions_general.php on line 46

    People are usually sent to this FAQ page when they get this:

    https://www.zen-cart.com/content.php...s-already-sent

    So I went and checked the winchester_responsive_defines.php to check out the first line and I don't see any issues with it (extra spaces or anything else). In fact I replaced it with the original one from the Winchester template (I have it customized), and I am still getting the same error.

    All I have on the first line is "<?php" (without the double quotes).

    So the FAQ does not seem to help me with this problem.

    If anyone has any thoughts, it would be much appreciated.

    Thanks,

    Laszlo

  2. #2
    Join Date
    Sep 2008
    Location
    WA
    Posts
    555
    Plugin Contributions
    0

    Default Re: Blank page - Cannot modify header information - headers already sent error

    Hi
    Did you check the end of the file also? What were you working on before it started? If you turn the default template back on does the error still occur? What editor did u use to look at the file?

    Linda

  3. #3
    Join Date
    Dec 2006
    Posts
    56
    Plugin Contributions
    0

    Default Re: Blank page - Cannot modify header information - headers already sent error

    Thanks for the help.

    Yes, it works fine with the default template so the Winchester files are at fault.

    I use Notepad to edit files. I checked the file again, there are no loose spaces or extra lines.

    As I mentioned uploading the original file instead of the modified one does not fix the problem.

    I was working on the Winchester slide out menu, its content is defined in includes/languages/english/extra_definitions/winchester_responsive/winchester_responsive_defines.php.

    I checked the timestamps of all the uploaded Winchester files and this is the only one I modified recently.

    I am at a bit of a loss ...

    Laszlo

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Blank page - Cannot modify header information - headers already sent error

    Quote Originally Posted by Laszlo View Post
    I use Notepad to edit files.
    Bad choice. Notepad messes with the end of line characters and this has been known to cause problems.

    Use "Notepad++" instead.

    I have a feeling that there is more to this than it may 1st appear though. Your current/live site indicates that it is using your edited file (based on the contents of the slideout menu) and this puzzles me, because the error log is telling us that there is something amiss with this file, so it (your slideout menu changes) *shouldn't* be working at all.

    What happens if you remove this defines file?

    The site should still work without it. The only difference you should see is that the 'defines' won't actually be functioning, so instead of (for example) your Categories header reading "Categories", it wiil/should appear as "HEADER_TITLE_CATEGORIES".

    Please report your findings as they will (hopefully) provide a further clue.

    Cheers
    RodG

  5. #5
    Join Date
    Dec 2006
    Posts
    56
    Plugin Contributions
    0

    Default Re: Blank page - Cannot modify header information - headers already sent error

    Thanks everyone, it is all fixed now.

    I deleted the file and the problem disappeared.

    So I installed vim, checked the file with it and there were three characters before <?php that Notepad did not display. I deleted them with vim, and everything works fine now.

    Not sure how they got there and how I had it not working with the original unmodified file as well.

    Anyway, now it is all fine.

    I have been working with Zencart for years and never used any other editor than Notepad for small changes.

    Leave and learn, I suppose.

    Thanks again:-)

    Laszlo

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Blank page - Cannot modify header information - headers already sent error

    Quote Originally Posted by Laszlo View Post
    Thanks everyone, it is all fixed now.
    Excellent. Thanks fr the update.

    Quote Originally Posted by Laszlo View Post
    Not sure how they got there and how I had it not working with the original unmodified file as well.
    I've no explanation for this as the original file doesn't contain any extraneous characters. Perhaps you viewed it with notepad at some stage and it got automatically resaved? No matter. It's not really important.

    Quote Originally Posted by Laszlo View Post
    I have been working with Zencart for years and never used any other editor than Notepad for small changes.
    I've not used notepad for many years, but it may have an option to change how it deals with the EOL characters, and if so, you may have changed it at some stage so that it doesn't cause this type of issue, and has somehow recently reverted back to its default?

    Another possibility for you not having a problem until now could be the files being edited. Many of them will function quite fine even with the extraneous characters EOL characters.

    However, I'm not convinced that either of these would apply in this case, because I can't see why Notepad would add characters to the very start of a file.

    It could also be related to character encoding perhaps (UTF-8 vs ISO-8859).

    We may never really know for sure.

    Cheers
    RodG

 

 

Similar Threads

  1. v151 Cannot modify header information - headers already sent by ,,,
    By mespe in forum General Questions
    Replies: 9
    Last Post: 2 Oct 2015, 08:27 PM
  2. Cannot modify header information - headers already sent
    By billc108 in forum General Questions
    Replies: 3
    Last Post: 21 Oct 2009, 10:14 AM
  3. Cannot modify header information - headers already sent
    By Fred5550 in forum General Questions
    Replies: 2
    Last Post: 12 Feb 2009, 04:38 PM
  4. Cannot modify header information - headers already sent by
    By laserayaneh in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 6 Sep 2006, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg