토모키

Centos 8 외부 mysql 접속이 안 될 때

[GCP]
  • 조회 : 1,172 / 댓글 : 0

되던 접속이 안 될 때, 오류 로그를 살펴보자.

[root@onnada-instance nginx]# tail -f /var/log/nginx/error.log 

2021/01/10 16:15:05 [error] 133349#0: *17 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli_connect(): (HY000/2002): Permission denied in /home/onna/lib/Core/Database.php on line 239" while reading response header from upstream, client: 175.197.46.206, server: onnada, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "34.xxx.xxx.xxx"

 

 

 

 

 

적용

[root@onnada-instance nginx]# setsebool -P httpd_can_network_connect 1

 

  • 비회원
  • 작성자
  • 비밀번호
  • 취소

대댓글 작성

비밀번호를 입력하세요.

비밀번호