Re: file_get_contents ($file) works -- file_get_contents ($url) returns false

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/12/14 Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx>
>
> On Mon, 2009-12-14 at 17:03 +0200, Cafer Şimşek wrote:
>
> René Fournier <m5@xxxxxxxxxxxxxxxx> writes:
>
> > On 2009-12-14, at 10:44 PM, Cafer Şimşek wrote:
> >
> >> René Fournier <m5@xxxxxxxxxxxxxxxx> writes:
> >>
> >>> 4.	as per php.ini, allow_url_fopen On
> >>
> >> Look at from phpinfo() the settings is already "On".
> >
> > Yes, I know.
> >
> > Which is why it's odd that the function fails on URLs.
>
> try to get url content from any browser or (if you use Linux / Unix)
> curl.
>
> --
> Cafer Şimşek
> DEV Staff Leader
> http://pazar.com/
>
>
> He already said Curl works, and changing the browser won't affect what PHP is doing.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>

Do you have a default stream context defined for the http stream?

A _LONG_ time ago, when I was using a firewall with NTLM
authentication (which PHP doesn't deal with), I had to route all my
calls through a local proxy.

This was the code I had ...

<?php
// Define the default, system-wide context.
$r_default_context = stream_context_get_default(
	array(
		'http' => array( // All HTTP requests are passed through the local
NTLM proxy server on port 8080.
			'proxy' => 'tcp://127.0.0.1:8080',
			'request_fulluri' => True,
		),
	)
);

// Though we said system wide, some extensions need a little coaxing.
libxml_set_streams_context($r_default_context);


Now, you may not see this in your code, but may be in a script which
is loaded via auto_prepend_file.

I would also suggest running something like WireShark at the same time
as your script. See if there is ANY traffic over the wire.

Do the cURL and file_get_contents() code generate identical requests?


--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux