Fixed: unable to connect to tcp://smtp.gmail.com:587 (Permission denied) trên Centos 6, 7
Case: cần gửi email từ server qua SMTP, thông báo lỗi:
Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Permission denied)
Cách sửa
Chạy 2 lệnh bên dưới để cho phép webserver gửi email ra ngoài
setsebool -P httpd_can_network_connect on
setsebool -P httpd_can_sendmail on
Nhận xét
Đăng nhận xét