If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.
Having problems, or maybe questions about WHT? Head over to the help desk!
If the website is hosted on the same physical server as the current server, the question becomes why do you want to access it through a URL? Its much more efficient to include the file through a file system path. If the website is on the same physical server and you are including the path via a URL then you are just going to bog down the server when the page gets a lot of hits. You would effectively be generating twice the load on the server as you would calling it through a file system path.
I couldn't agree with you more! Unfortunately, this is a fairly large site and my clients webmaster has done it this way on way too many pages to change. Plus my client is aware that it works on another server. So I need to come up with the solution. I'm fairly sure it just a configuration issue, but I don't know what config to change and to whatt?
You need to enable allow_url_include in your php.ini file or set up a personal php.ini for the account.
I would really stress with the developer that this is not the way to go. This really just contributes to a lot of the problems with a lot of PHP scripts. Developers seem to disregard security and efficiency and focus solely on a method that works easier for them. I just don't think programming something like this is a good idea.
1) The site in question ( www.ANYDOMAIN.com ) is NOT resolving within the server.
2) allow_url_fopen turned off.
3) Outbound port 80 connections are blocked in server's firewall.
1. I can ping www.ANYDOMAIN.com from within the server.
2. According to the documentation allow_url_fopen must be on
3. I changed the firewall settings to allow port 80 in and out. I also disable the firewall to see if the firewall was creating the issue.
So that being all said. Here's the fix.
Virtual host file has:
php_admin_flag allow_url_fopen Off
php_admin_flag allow_url_include On
I figured I'd give your #2 a try and it worked!!! Don't know why but it did!
Many Thanks for everyones help here! This is why this place is the best! Hopefully someday I will be able provide help to someone, like everyone here has for me! Thanks again!!