error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
environment: thinkphp framework, Linux, ali cloud RDS database
ping link address normal:
error reporting process: access the background address, most are normal access, refresh 10-20 times may appear 1-2 error, not continuous error
solution 1:
restart php-fpm service
service php-fpm restart
the original view: https://stackoverflow.com/questions/2661546/php-network-getaddresses-getaddrinfo-failed-name-or-service-not-known p>
special thanks to: https://blog.csdn.net/qq_37500838/article/details/85008432#commentBox p>
p>
solution 2:
configure DNS resolution to 114.114.114.114
check DNS configuration: cat /etc/resolv.conf
I use the first solution, the second solution is temporarily useless, configuration method can be found on the Internet
p>
Read More:
- php_ network_ Getaddresses: getaddressinfo failed: name or service not known solution
- Build LNMPR Error — php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
- After upgrading php7, PHP program prompts an error: operator not supported for strings in causes and Solutions
- php open(/var/lib/php/session/sess_4ofxxx, O_RDWR) failed: Permission denied (13)
- Linux virtual machine network “job for” network.service failed because the control process exited with error code”
- PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[08004] [1040] Too many connections
- Job for network.service Failed because the control process exited with error code. See “SystemC
- PHP – PHP Error[2]: Error while sending QUERY packet. PID=*
- PHP big file upload problem (500m or above)
- ERR_CONTENT_DECODING_FAILED error occurs in PHP program, summary of solutions
- PHP:Fatal error: Class ‘COM’ not found in … How to deal with the problem
- CentOS 8.1 solution to error in executing #systemctl restart network.service
- Debian using networking to restart the network can not start the solution of network card
- The media could not be loaded, either because the server or network failed or because the format is
- PHP message:filesize(): stat failed for Error
- PHP connection to MySQL database error: call to undefined function MySQL_ connect()
- nt service 1072 No need to restart, repeat the method of installing the service program or service driver
- Error:join network can not connect to Zerotier service
- The most complete solution for service network restart failure under CENTOS 7
- Fatal error in PHP project: class’ redis’ not found