A
A
Apostol632018-04-24 09:12:15
PHP
Apostol63, 2018-04-24 09:12:15

Error Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed while parsing?

5adec9578cd47203315706.png5adec95c2e6e7750015970.jpeg
Good afternoon.
I am writing my first parsing
using the simple html dom library
. And when I get links from the file that I also need to run through and insert them through the name of the array (line 23), an error always occurs
. At what on the server side everything is in order.
allow_url_fopen is set to true (I asked the hosting technical support)
And in general, if I insert the url not through a variable, then everything works correctly
for the 2nd day I can’t solve the problem

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Arkhipov, 2018-04-24
@arvitaly

You have the $general_link and href of each link concatenated, but there are also absolute paths.
It turns out that you are requesting domain.ru/http://domain2.ru.
Always check at the call site which arguments you are sending to the function, either by debugging or logging.

C
Codebaker, 2018-04-24
@Codebaker

Your call to file_get_html() on lines 115, 121 may return false, but you don't check $page for false on line 24. By the way, this is exactly what you wrote in Fatal error: an attempt to call a member is the find () method on a boolean variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question