【WordPress】CentOS 6.10 测试WP发送邮件失败

1、错误信息如下:

  SMTP -> ERROR: Failed to connect to server: Permission denied (13)

 

2、解决方法:

  https://gistpages.com/posts/phpmailer_smtp_error_failed_to_connect_to_server_permission_denied_13_fix

 

3、查看phpmailer状态

$ getsebool httpd_can_sendmail
httpd_can_sendmail --> off
$ getsebool httpd_can_network_connect
httpd_can_network_connect --> off

4、以上可以看出,需要打开连接

$ setsebool -P httpd_can_sendmail 1
$ setsebool -P httpd_can_network_connect 1

 

posted @ 2018-08-07 17:36 FeCodeTech 阅读(...) 评论(...) 编辑 收藏