how to enable or install pdo extansion for php , i cant use easyapache and i cant find php.ini in WHM

after install script on host i get this error:

 Fatal error: Class 'PDO' not found in /home/jafar/public_html/model/db.cls.php on line 29 

script dont have any problem and work correctly on localhost.i think if i can install or enable it can successfull run and install script.

3 Answers 3


You can enable PDO in cPanel if you have cloudlinux installed. In cPanel search for PHP Version and on the resulting screen select and enable PDO and finally select save. * http://docs.cloudlinux.com/index.html?using_php_selector.html

If you do not have CloudLinux and PhpSelector installed you will need an administrator account to install PDO through easyapache. In WHM follow this guide:

Enabling PDO in Easyapache

  1. Log in to WHM ( http://domain.com/whm )
  2. Goto WHM »Software »EasyApache (Apache Update)
  3. Select "Previously Saved Config (** DEFAULT **)" and click "Start customizing based on profile"
  4. On the "Apache Version" page click "Next"
  5. On the "PHP Version" page click "Next"
  6. On the "Short Options List" page click"Exhaustive Options List"
  7. On the "Exhaustive Options List" ensure that PDO, PDO sqlite and PDO MySQL are selected.
  8. Then Click save & Build on the bottom of the page.

if the answer from "Citizen Kepler" did not help you

try changing the timezone that's what fixed my problem check this question


Follow the rebuild answer, and if it runs on browser calls and not in cli calls, run php-cli --ini and it points to /usr/local/bin/php.ini. Edit the file with nano /usr/local/bin/php.ini or vim /usr/local/bin/php.ini and add the following:


Applicable to Centos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.