Re: fopen for http://
| From: | Peter Brodersen | Date: | Fri, 27 May 2005 21:40:23 +0000 |
| Subject: | Re: fopen for http:// | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-215906@lists.php.net to get a copy of this message | ||
On Fri, 27 May 2005 13:57:12 -0500, in php.general jpaulson@sedl.org
(Jay Paulson) wrote:
>For example, in my Apache httpd.conf file I have it set up to where I
>have a directory that is only accessible from certain IP addresses, one
>of which is 127. (the localhost). The script I'm running is located on
>the server and the web site I'm trying to access via fopen() is on the
>same server. Therefore, I'm thinking that the php script should have
>access to read the site's restricted directory. For some reason it
>does not have access.
Even if it is the same server you might not connect with "127.0.0.1"
as the source IP address - especially not if the other web site's host
name resolves to any other IP address than 127.0.0.1. Your tcp
connection might still be performed via the loopback-interface, but
your source IP address might still be the one of a network interface
Try to create a page on the second web site (that you want to access
thorugh fopen() ) that outputs the client's IP address. You'll
probably see that your source IP address is not 127.0.0.1.
--
- Peter Brodersen