I know that this line:
set_include_path(get_include_path() . PATH_SEPARATOR . '/my/other/path');
add '/my/other/path' to the list of directories where require, include (and others) functions look for files.
But this option is valid only for path specified without ./ or ../ at the begin of path. For example:
// I would include /my/other/path/Zend.php
require('Zend.php'); // it works
require('./Zend.php'); // it does not works
// or if I would include /my/other/Zend.php
require('../Zend.php'); // still does not works
However I’m searching a way for do it
NOTE: This is for an eccentric project. In this case I cannot modify the file with include and require functions.
IMO, the only thing you can do in order to achieve that is chdir: you set the current working directory to one that fits the relative routes.