Fixes for open_basedir or safe mode enabled servers with s3