Applicable to:
- Plesk for Linux
Symptoms
-
Database connections made through PHP fail.
-
The Plesk database is accessible. Other databases can also be accessed directly via MySQL/MariaDB.
-
SELinux is enabled in enforcing mode:
# sestatus | grep 'Current mode'
Current mode: enforcing -
Messages similar to below appear in /var/log/audit/audit.log:
CONFIG_TEXT: type=AVC msg=audit(1739696552.295:5057): avc: denied { connectto } for pid=74152 comm="php-fpm" path="/var/lib/mysql/mysql.sock" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_stream_socket permissive=0 type=SYSCALL msg=audit(1739696552.295:5057): arch=c000003e syscall=42 success=no exit=-13 a0=6 a1=7fff7a1224a0 a2=1b a3=1 items=0 ppid=74143 pid=74152 auid=4294967295 uid=10020 gid=1003 euid=10020 suid=10020 fsuid=10020 egid=1003 sgid=1003 fsgid=1003 tty=(none) ses=4294967295 comm="php-fpm" exe="/opt/plesk/php/8.2/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)ARCH=x86_64 SYSCALL=connect AUID="unset" UID="**REDACTED**" GID="**REDACTED**" EUID="**REDACTED**" SUID="**REDACTED**" FSUID="**REDACTED**" EGID="**REDACTED**" SGID="**REDACTED**" FSGID="**REDACTED**"
type=PROCTITLE msg=audit(1739696552.295:5057): proctitle=**REDACTED**
Cause
SELinux is blocking the database connection requests made through PHP-FPM.
Resolution
-
Connect to your Plesk server via SSH.
-
Restore SELinux content for mariadbd file:
# restorecon /usr/sbin/mariadbd
-
Restart MariaDB service:
# systemctl restart mariadb
Comments
0 comments
Please sign in to leave a comment.