How to enable PDO Extension on my domain?

Written by
Ella McMorran
Ella McMorran
PDO (PHP Data Objects) provides a consistent interface for database access in PHP. Most modern PHP applications require it for MySQL, PostgreSQL, or SQLite connections. CloudLinux lets you enable it per-domain without affecting other accounts.
To enable PDO extension for your domain:
- Log into your domain’s cPanel account
- Navigate to “Select PHP Version” in the Software section
- Change from “native” to a specific PHP version (7.4, 8.0, 8.1, etc.)
- Click “Set as Current” to apply the version
- In the PHP Extensions list, check both:
- pdo (the core PDO extension)
- pdo_mysql (for MySQL database connections)
- Click “Save” to activate the extensions
Changes apply immediately without restart.
Note
Note: These settings apply only to individual cPanel accounts, not WHM reseller accounts. Each domain must enable PDO separately.
Troubleshooting tip: If your application still shows PDO errors after enabling, check that you’ve enabled the specific PDO driver for your database type (pdo_mysql for MySQL/MariaDB, pdo_pgsql for PostgreSQL, etc.).