line 5 would have been the closing php tag of the error reporting code
2- if(!session_id()) session_start();
the issue was that you copied an errant space after the closing php tag:
this errant space was causing the error you got. put the error reporting code back withou the space at the end of line 5.