0

I have the below code that tries to pull text from an url.

include_once("html_parser/simple_html_dom.php");
$html=file_get_html("http://82.77.18.164:8080/Iphone/get_puncte.php");

print_r($html);

echo file_get_contents("http://82.77.18.164:8080/Iphone/get_puncte.php");

echo stream_get_contents(fopen('http://82.77.18.164:8080/Iphone/get_puncte.php', "r")); 

If i access the url in my browser it works fine, but in when i access the php file with the code above i receive the below erros.

PHP Warning:  file_get_contents(http://82.77.18.164:8080/Iphone/get_puncte.php): failed to open stream: Connection refused

PHP Warning: stream_get_contents() expects parameter 1 to be resource, boolean given in /home/xxxxx/public_html/test.php on line 9

Any idea ?

2
  • 1
    allow_url_fopen is likely disabled. Commented Jan 5, 2018 at 12:57
  • allow_url_fopen On On Commented Jan 5, 2018 at 13:05

1 Answer 1

2

Some servers deny using an IP address instead would recommend to use curl

Sign up to request clarification or add additional context in comments.

1 Comment

can you vardump the result to double check if its actually empty

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.