realpath is a function on the site so its impossible to tell. check the lines above it make sure you havn't missed a ; at the end ect.
edit: ive just had that error it means that you have missed a . somewhere eg.. you hav done $var $var2 but it should be $var . $var2 the . joins them together if its not there it will give you that error