symfony and cPanel “couldn’t locate driver named mysql”

I was experiencing this earlier today on a cPanel install to which I had deployed a symfony application. The solution was to install the PDO_MYSQL Pecl module. Here’s how you do it:

  1. Log in as root to your cPanel install
  2. Under the Software menu on the left, click “Module Installers”
  3. Click Manage, next to the PHP Pecl item
  4. Search for “PDO” using the search
  5. Click “Install” in the PDO_MYSQL row
  6. Clear your symfony cache, and away you go!