Jump to content

Different behavior in localhost and webhosting account - fopen()


zerandib

Recommended Posts

Hello

 

I have read a webpage content using PHP fopen()

it works fine

But it gives different results when im executing that code in localhost and in my web-hosting provider

 

in localhost: (Executing in the localhost)

After reading the webpage content i have locate the place where .flv file resides. and got that URL

Ex: http://www.myweb.com/variable1/fixedpart/myvideo.flv

and im able to download this video.

 

 

but in the web host when i run this, (Executing in the web-hosting account)

After reading the webpage content i have locate the place where .flv file resides. and got that URL

Ex: http://www.myweb.com/variable2/fixedpart/myvideo.flv

and here im unable to download the video

 

Note that i have execute the same PHP file in my localhost and web hosting area.

I have tested this on 2 hosting accounts. the result is the same. that is even im getting the .flv URL im unable to download that video.

Says, im not authorized to download the video.

But in localhost, no issues. im able to download the videos from the generated flv link

 

Whats the issue behind this?

how to reslove this!  :?:

I had this issue with my old webhost and getting the stats of a counter strike server. It turned out that they had a firewall on and even though allow_url_fopen was enabled the firewall was blocking the requests. I am afraid this is defiantly a question for your host. Hopefully your host will be like mine and just add a rule in for you!

If the site where the video resides is using some authentication and that authentication is working on one server but not another, then the code is probably doing something that is server configuration specific and you would need to post your code in order for anyone to be able to help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.