What I want do to is to include \'file1.php\' from \'domain1\' into \'file2.php\' on \'domain2\'. So what I figured I should do is something like this:
file2
what you are using is bad practice. put the dependent code into domain specific. Duplicating the same code is the right approach as it does not affect the operation of both sites.
Try creating the symlink of file1.php and included that as if it is from the local directory.
also make sure that .htaccess has the followsymlink option set to true
how about trying this in your file2.php in domain2?
require_once '../../../domain1/httpdocs/file1.php';