Use real path on DB content and program path, exactly:
1. On caller program path - always
2. On file associated with operation path - only on open operation
This will remove problem with configuration
RealPath is C standard library call: man realpath (3).