Home >Backend Development >PHP Tutorial >PHP prompts Warning: file_get_contents(): couldn't resolve_PHP Tutorial
php prompts Warning: file_get_contents(): couldn’t resolve
I was using a Caiji function today, and suddenly “
Warning: file_get_contents() [function.file-get-contents]: couldn't resolve host name in ……
There was no problem in the local test. I checked some information on the Internet and found that it was a DNS problem. Here’s the solution:
Use ssh to connect to linux vps and modify the dns of the vps host.
vi /etc/resolv.conf
The content inside is directly modified to:
nameserver 114.114.114.114
nameserver 8.8.8.8
Just save it, no need to restart.
Test again, OK!