Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)

If you run into the above error one of the things to check is for SELinux denying connections via php-fpm by tailing the audit log while trying to access the wordpress plugin page:

# tail -f /var/log/audit/audit.log
type=AVC msg=audit(1649776217.358:1050): avc:  denied  { name_connect } for  pid=20795 comm="php-fpm" dest=80 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=0
type=SYSCALL msg=audit(1649776217.358:1050): arch=c000003e syscall=42 success=no exit=-13 a0=a a1=7ffea97ef1d0 a2=10 a3=36b6ae items=0 ppid=20636 pid=20795 auid=4294967295 uid=994 gid=991 euid=994 suid=994 fsuid=994 egid=991 sgid=991 fsgid=991 tty=(none) ses=4294967295 comm="php-fpm" exe="/usr/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)ARCH=x86_64 SYSCALL=connect AUID="unset" UID="nginx" GID="nginx" EUID="nginx" SUID="nginx" FSUID="nginx" EGID="nginx" SGID="nginx" FSGID="nginx"

If you see that SELinux is denying php-fpm like this example then run the following to allow access:

# setsebool -P httpd_can_network_connect 1

Leave a Reply

Your email address will not be published. Required fields are marked *