I had the same problem as machi had previously. I later found the error is originated from space between closed bracket (i.e ‘)’) at the first line of the code.
<?php if ( function_exists('register_sidebar') )
register_sidebars(2); ?>
Remove the space between both closed brackets and it should fix the problem.