background
After installing Ubuntu subsystem in Win10 system, L(Linux)N(Nginx)M(mysql)P(PHP)R(Redis) environment was set up.
The error message
php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
The screening process
- check whether the services of nginx, php-fpm and redis-server are started normally;
sudo /etc/init.d/nginx status
check whether win10 can ping the ubuntu subsystem; Check if Redis configuration is correct; Check that Hosts is configured correctly; is finally determined that DNS cannot be resolved normally, and DNS configuration
needs to be modified
The solution
Gateway configuration:
, 1 sudo vi/etc/resolvconf resolv. Conf., d/base code>
# 添加下面网关(223.5.5.5 和 223.6.6.6 是阿里的网关)
nameserver 223.5.5.5
nameserver 223.6.6.6
2, sudo resolvconf-u
will synchronize the configured DNS to /etc/resolv.conf
3, check vi /etc/resolv.conf
whether there is a newly configured DNS
4. Restart PHP sudo /etc/init.d/php-fpm restart
Read More:
- Linux’s method of clearing DNS cache and refreshing DNS in shell terminal (Ubuntu, Debian)
- CentOS uses Yum install to report errors
- [Solved] Centos7 Wget Error: nown. wget: unable to resolve host address ‘mirrors.aliyun.com’
- nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
- Ubuntu network configuration+Fixing “Failed to bring up eth0” in Ubuntu
- Linux Ping error name or service not known
- Microsoft Store install Ubuntu
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- Connection error:Cannot connect to redis-server. Details are available in connection log.
- Redis cli create creates an error when creating a cluster
- Error: unable to process source
- ubuntu executes apt-get update and reports Failed to fetch/replace Ali source
- (20200916 Solved)Docker||redis-cli Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Some index files failed to download. They have been ignored, or old ones used instead
- Nextcloud error: “access forbidden CSRF check failed”
- /var/run/nginx/nginx.pid” failed (2: No such file or directory)
- nginx: [error] invalid PID number in /var/run/nginx.pid
- Resolve nginx startup failure
- Nginx error: nginx: [error] invalid PID number “” in “/run/nginx.pid”
- ERR Slot 3300 is already busy (Redis::CommandError)