SELinux preventing Apache executed scripts from communicating with MySQL

Solution Verified - Updated -

Issue

  • mysql is running and it will connect with the CLI via the socket in /var/lib/mysql/mysql.sock. However, PHP scripts executed through Apache cannot connect via the socket
  • Seeing SELinux avc denials when attempting to have httpd connect to mysql

Environment

  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content