Can I use an includes folder on one website and set up "trusted domains/IPs" that are allowed to access the files in this folder (all other domains/IPs are restricted)? All the sites are on the same shared hosting server, the global site has a dedicated IP, the others share a different IP.
Is this too insecure to allow PHP includes across domains?
If this scenario is not possible to configure, are there some alternatives to share server-side files globally and relatively securely?
Edit: Server is Apache
When including files across domains it gives the error:
Warning: include(/home/user1/public_html/file.php) [function.include]: failed to open stream: Permission denied in /home/user2/public_html/file.php