Here's a simple way of having safe_mode on, while still allowing PHP scripts to modify files:
phpSuExec,
How that works is, it allows the running of such php functions as function.mkdir, function.mvdir, function.mv, function.chmod and many more, while still allowing protection with safe_mode.