Question about PHP files 'required' with fopen_wrappers
Posted: Thu Jan 17, 2008 12:59 pm
I have a question about the require() and include() functions. Here is my example scenario:
On Server A, I have a PHP script that require()'s a PHP script on Server B, using HTTP protocol and fopen_wrappers. The script on Server B prints out the IP address using $_SERVER["SERVER_ADDR"]. So, when I run the script on Server A, the script ends but prints out 2.2.2.2 (which is the IP address of Server B)
My question: is it possible to include() or require() a script from a DIFFERENT machine, but have that script run and process on the machine that called it? My desired output from the above example would be 1.1.1.1, rather than 2.2.2.2 I have some third-party PHP libraries I wrote, and I don't want to have to copy them to each and every server where I want to use them. My idea is to just require() them from a stand-alone library server, but they need to run and process as if they were on the local machine that's calling them.
Thanks in advance for any help!
Code: Select all
Server A Server B
IP : 1.1.1.1 IP : 2.2.2.2
PHP: v 5 PHP: v 4
My question: is it possible to include() or require() a script from a DIFFERENT machine, but have that script run and process on the machine that called it? My desired output from the above example would be 1.1.1.1, rather than 2.2.2.2 I have some third-party PHP libraries I wrote, and I don't want to have to copy them to each and every server where I want to use them. My idea is to just require() them from a stand-alone library server, but they need to run and process as if they were on the local machine that's calling them.
Thanks in advance for any help!