in reply to File ownership
Chances are good the webserver isn't running the script as you, so the directories created are not owned by you, and you are not allowed to change them.