I wouldn't depend on safe_mode much. It will be gone in php 6.0 anyway.
A quote from "Month of PHP Bugs" by the former "chief" of php-security group:
Safemode and open_basedir are flawed by design and will always have security holes like this one (or all the local exploits we demonstrated). The security of your server setup should therefore NEVER rely on these directives.
On the MOPB there are two examples (for zip and bzip url wrappers) of fooling safe mode.