0

I want use fopen function for open a .ts file

$handle = fopen("http://host:80/live/stream/bbc/105.ts", 'rb');

it work on localhost but not working in shared hosting i get this error:

Warning: fopen(http://host:80/live/stream/bbc/105.ts): failed to open stream: Connection refused in /home/botocycy/public_html/xStream/mytest2.php on line 4 bool(false)

how i can solve this problem ?

Abdes
  • 710
  • 1
  • 10
  • 23

1 Answers1

0

If you use localhost, you try to connect to the server the script is running.

If you are on a shared host, localhost identifies the server too.But how may the server identify the vHost your script is running. All vHosts of the shared hosting are on localhost. The server uses the domain name to route a HTTP to one respective vHost.

Replace localhost by the actual domain name of your vHost, to allow the shared host to route the HTTP request to your individual host.

SteAp
  • 10,824
  • 8
  • 48
  • 83