Recently, I encountered “pdo class not found” error, while I was installing NextCloud. After searching a lot, the solution was pretty simple.

If you are using WHM

Go to Easy Apache 4, In the Currently Installed Packages section, click on the Customize button. Click on the PHP Extensions option from the left. In the Search field, type to enter ‘pdo‘. Click the toggle button(s) next to the PHP version(s) that you would like the PHP extension installed for.

Click the Review option from the left.

Confirm the options you selected are listed under the “Please review the following list of packages you are about to install by provisioning this profile.” section. Then, click the Provision button.

Once the installation is completed, you will receive a message: “The provision process is complete”. Click the Done button to finish.

If you are using cPanel

Go to Select PHP Version and check PDO and save.

If you follow these steps, this should resolve the issue.

If you have any questions ping me Twitter on leave a comment below.