My feeling is that $path here should be relative to root, not to current directory of whatever file php happened to execute. But this is php so this sort of thing is not surprising.