Originally Posted by Rick
Will have to allow it to run under both methods, but when safe mode is on it's not going to be as scalable since we can't create new directories. We'll have to just stuff everything into one directory on that condition.
It is not really a safe mode problem but a permission issue with mod_php. Basically, Apache's PHP module is creating the directories under the owner/user of the Apache webserver instead of the owner/user of the script. With enabled safe mode the script and directory must have the same owner.

A fix for this problem is using PHP with suexec. Some hosting control panel such as the pretty popular cPanel have suexec support.

On another note, it is also possible to store files in the MySQL database. This is sometimes even faster then files on the file system.