I have a php script on a Ubuntu server which creates files. It works well with relative paths specified with `.’ but it does not see the parent directory.
header('X-Real-Path1: ' . realpath('..')); <-- empty string
header('X-Real-Path2: ' . realpath('.')); <-- returns the actual directory
header('X-Real-Path3: ' . realpath(__DIR__)); <-- returns the actual directory
header('X-Real-Path4: ' . realpath(__DIR__. '/../')); <-- empty string
The user which runs the script has full access to the directories. Why doesn’t the script see the directories?