There are possibilities to achive this, but they imply so much work that it'd be much easier to have a cron job on server 2 checking last modified date of file2 and upload the file to server 1 if it has been changed...
I mean, really...
In case you have a way to have the file2.php to be displayed without being parsed by the web server (which is in NO CASE secure at all), the process would be:
Code:
$foreignCode = implode('',file('http://www.server2.com/file2.php'));
eval($foreignCode); On server2, if the file is used like require('file2') or include('file2'), name it in .txt so that apache won't try to interpret it when server1 downoads it... include will still work, whaever be the filename.
Finally, remember that it is a
Very Bad Idea™ to have server 1 connect to server 2 every time an end-user request a page on server 1...