Home >Database >Mysql Tutorial >Why Am I Getting a \'PHP Fatal Error: Class \'PDO\' Not Found\' and How Can I Fix It?
Encountering the error "PHP Fatal error: Class 'PDO' not found" indicates that your project is attempting to utilize the PHP Data Objects (PDO) extension, but it's not available. The information provided includes relevant details regarding PDO's availability and configuration, including the enabled drivers:
PDO support => enabled PDO drivers => sqlite, sqlite2, mysql
Despite having PDO support enabled, the error suggests that the MySQL driver for PDO is not installed or loaded.
To resolve this issue, execute the following commands:
yum install php-pdo yum install php-pdo_mysql
After installing the necessary PHP extensions, restart the web server:
service httpd restart
These steps should resolve the issue by installing the missing PDO MySQL driver and enabling its functionality.
The above is the detailed content of Why Am I Getting a \'PHP Fatal Error: Class \'PDO\' Not Found\' and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!