Serve files from outside the directory (safely?) #736
-
Is there a safe way to serve files from outside the directory tree? I want to serve 2 directories I cannot move into the DirectoryLister tree as they are on different file systems. I tried symlinks but that doesn't work because of the Can I safely remove the Update: I used a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I wouldn't recommend removing/disabling the I'm unfamiliar with One other thought that occurred to me would be to add the directory paths you want to symlink to the // Set file access restrictions
ini_set('open_basedir', __DIR__:/some/other/directory:/yet/another/folder); This may even be a configurable option I can add to the app directly. Will have to look into that in the future. |
Beta Was this translation helpful? Give feedback.
I wouldn't recommend removing/disabling the
open_basedir
directive. This prevents access to files outside of you Directory Installation (e.g. system files). As you stated, symlinks don't work however I do believe hard links should since they appear as an actual file at the location specified.I'm unfamiliar with
nullfs
mounts so can't attest to how good or bad an idea they would be but am glad it worked for you.One other thought that occurred to me would be to add the directory paths you want to symlink to the
open_basedir
directive manually. For exampleThis may even be a configur…