S
S
Sergey2019-07-24 15:12:32
PHP
Sergey, 2019-07-24 15:12:32

PHP 7.3 - Could not resolve host in curl. How to fix?

Curl from under the puff will not resolve any hosts.
get_file_contents doesn't resolve either.
From under the terminal everything works, that is, the problem is in php. It's on debian 9.5.
How to be?
None of the curl options help. works, returns IP, and the same under fpm returns the domain name
php -r "echo gethostbyname('rest.modx.com');"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-07-24
@xmoonlight

Check environment variable settings: here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question