I have two php files on two servers. Lets call them server A and server B.
I want my php file on A to include the code in file on B.
What php directives must be enabled on both servers?
Also, when a remote file is included, will the code of the file be included or the output of the code (as in, echo data) sent to the requesting script?
On Server B, you should set, in your php.ini, the value of allow_url_include
to On
. Be wary though that there are major security repercussions with using allow_url_include
so use very carefully and do a lot of due diligence before doing this.
If you want only one directory to allow PHP files to be included by another server, then you can just create an .htaccess file with the following line:
php_flag allow_url_include on
Whatever your file structure is, then allow_url_include
is a security concern (unless your server is not accessible to the outside world).