Off-site access restriction from on-site PHP, Trying to use 'file' or 'file_get_contents' |
![]() ![]() |
Off-site access restriction from on-site PHP, Trying to use 'file' or 'file_get_contents' |
| info@... |
Nov 17 2009, 07:02 PM
Post
#1
|
|
Group: Members Posts: 2 |
Hi Guys,
I am TRYING to access an external web server from my Yahoo hosted PHP script. I know the script is valid as I can easily run it from my localhost. But when I copy the script to my site hosted on Yahoo, the script fails, and I know it fails; whenever the file or file_get_contents PHP function is used. For example, $array = file('www.yahoo.com'); or $string = file_get_contents("www.google.com"); (Yahoo & Google are here only for example). I really get the feeling that there is a permissioning issue on my/all (?) Yahoo hosted sites. Or is it a Yahoo firewall? This is really concerning me as I want to access important information hosted on an external (from Yahoo) site. This is a real show stopper. Urgent answer required (trex_4321 at yahoo dot com), if possible. Otherwise off to another hosting service. |
|
|
|
| Sony AK |
Nov 23 2009, 07:08 PM
Post
#2
|
|
Group: Members Posts: 3 |
Hi Guys, Have you try using cURL? Best regards, Sony AK http://www.sony-ak.com |
|
|
|
| rnd@... |
Nov 25 2009, 05:57 AM
Post
#3
|
|
Group: Members Posts: 1 |
Hi Guys, In php.ini the "allow_url_fopen" value is changed to 0 (default is 1) causing file_get_contents(URL) to fail, affecting YAHOO! API access. |
|
|
|
| ronp |
Jan 11 2010, 12:47 PM
Post
#4
|
|
Group: Members Posts: 1 |
In php.ini the "allow_url_fopen" value is changed to 0 (default is 1) causing file_get_contents(URL) to fail, affecting YAHOO! API access. I understand that, but I can't understand why curl doesn't work on external files. CODE This function only works on files that fopen will work with not external files. Can't figure out why. Help! |
|
|
|
![]() ![]() |