PHP Fatal error: Class 'PDO' not found PHP Fatal error: Class 'PDO' not found php php

PHP Fatal error: Class 'PDO' not found


try

 yum install php-pdo yum install php-pdo_mysql service httpd restart


Try adding use PDO; after your namespace or just before your class or at the top of your PHP file.


This can also happen if there is a php.ini file in the web app's current working directory. If one has been placed there to change certain settings, it will override the global one.

To avoid this problem, don't use a php.ini file to change settings; instead you can:

  • Specify settings in the vhost declaration
  • Use an .htaccess file with php_flag (see here)
  • Use an .user.ini file (see here)