Hi,
Background: I'm wanting to include a script that will be included into many other scripts (probably most of the scripts that I will write). This path from the root to the script will remain the same, though the script itself may change physical location in a server cluster, and the scripts that include it could be anywhere in the cluster.
My question has a few parts:
1) Assuming a file lies on the same domain (but not necessarily the same machine), is there much of a performance penalty in including a php script by using the full path (including rather than just the relative location? (I'd include files with an extenstion other than .php so that they would definitely not be parsed.)
2) (This is perhaps more of a DNS question.)
How are local domain names resolved with PHP? Specifically, if your server domain is and your current machine holds some sub-directories e.g. does PHP think that your current machine is the whole of even if it only holds those sub-directories?
Does this have to do with server settings in the configuration files PHP, of the web server that PHP is running on, the DNS records on the local machine, or purely the DNS server that the machine connects to on the local network?
3) Is the best way to include this file something like:
<?php
...
$root = "_SERVER[SERVER_NAME]"."/path/to/script";
include "$root";
...
?>
or can anyone think of a better way?
Thanks in advance for any responses.
Background: I'm wanting to include a script that will be included into many other scripts (probably most of the scripts that I will write). This path from the root to the script will remain the same, though the script itself may change physical location in a server cluster, and the scripts that include it could be anywhere in the cluster.
My question has a few parts:
1) Assuming a file lies on the same domain (but not necessarily the same machine), is there much of a performance penalty in including a php script by using the full path (including rather than just the relative location? (I'd include files with an extenstion other than .php so that they would definitely not be parsed.)
2) (This is perhaps more of a DNS question.)
How are local domain names resolved with PHP? Specifically, if your server domain is and your current machine holds some sub-directories e.g. does PHP think that your current machine is the whole of even if it only holds those sub-directories?
Does this have to do with server settings in the configuration files PHP, of the web server that PHP is running on, the DNS records on the local machine, or purely the DNS server that the machine connects to on the local network?
3) Is the best way to include this file something like:
<?php
...
$root = "_SERVER[SERVER_NAME]"."/path/to/script";
include "$root";
...
?>
or can anyone think of a better way?
Thanks in advance for any responses.