We recently got a weird bug, and I'm wondering if anyone has encountered it.

When Magento generates the WSDL (v2) it started adding an extra whitespace before the declaration.

This seems to pretty much break the internet :) .

I've grep'ed the entire code base and there are no whitespaces before XML decelerations anywhere.

Also, to add a topping, no errors are generated anywhere...

Thank you

  • 3
    + 1 for "break the internet". :)
    – Marius
    May 29, 2014 at 15:03
  • 2
    Oh, I had this issue before. I'm looking at my old code. I'm surprised this hasn't been asked before. +1
    – kab8609
    May 29, 2014 at 15:16
  • 3
    I had this issue also once but for us an additional whitespace in the index.php was the problem. Did you check this file already? Jun 3, 2014 at 10:20
  • 1
    Did you already solve your problem? Jul 24, 2014 at 14:48
  • 1
    You need to remove UTF-8 BOM from project php files [stackoverflow.com/questions/204765/… [1]: stackoverflow.com/questions/204765/…
    – i42
    Dec 25, 2014 at 11:47

3 Answers 3


Try using this script to find the extra whitespace:


You'll obviously need ssh for this and you should backup your files before running this or any script that edits your files


It's almost certainly a blank line at the start of a file.


Remove any characters (spaces, tabs etc..) before <?php at beginning of *.php files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.