2

After I changed something in my .php file my whole site got an error. I changed the file back to the old one but now I get this error at the top of my page:

Warning: Cannot modify header information - headers already sent by (output started at /home/test/domains/test.nl/public_html/wp-content/themes/mugen/engine/theme-scripts.php:1) in /home/test/domains/test.nl/public_html/wp-content/plugins/woocommerce/classes/class-wc-session-handler.php on line 63

The plugin is Woocommerce but it was working before with the same code but now I keep getting this error at the top.

Code of the file I changed aka the theme-scripts.php file:

http://pastebin.com/mU4DNLnm

Fabien Sa
  • 9,135
  • 4
  • 37
  • 44
Tim Jake
  • 57
  • 2
  • 8

2 Answers2

3

How did you edit the file? I'd guess you now have a Unicode Byte Order Mark at the beginning of it. Can whatever editor you used save the file with the option "without BOM"? Most decent ones can.

The big clue here is that your error comes from line 1, and line one of your file is just:

<?php

...which is an indicator that there may be something "invisible" right at the start of the file.

Matt Gibson
  • 37,886
  • 9
  • 99
  • 128
  • Thanks alot fixed my problem :) I was saving it with Notepad and UTF-8. I made a new file without using UTF-8. That fixed my problem. Thanks alot again – Tim Jake Nov 12 '13 at 09:47
  • No problem. Bear in mind that UTF-8 is fine (and is pretty much the standard for the web) -- you can save files as UTF-8 without the BOM if you want, and that's what I'd recommend. – Matt Gibson Nov 12 '13 at 10:17
1

This error normally means you have already 'print'ed or 'echo'ed some text before php trying to write into the header info.

Shang
  • 85
  • 7