It would help to tell us what the "strange" error is.
Without knowing, all I can do is guess that it's a permissions issue, which is often the case when you set up your site using your host login account, but then your PHP scripts are executed by the Apache account. Thus you may have to set read/write/execute for all on the directory where you want your script to create the directory -- which may have security ramifications, so choose wisely where you want this to happen in your directory tree.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation