Answer the question
In order to leave comments, you need to log in
How to fix Class PDO not found error in Yii2 on Ru-Center hosting?
Regular hosting at Ru-Center. PHP 7.
PDO and PDO_MYSQL extensions included.
Framework Yii2.
When trying to migrate... php yii migrate
...the following error occurs:
PHP Fatal Error 'yii\base\ErrorException' with message 'Class 'PDO' not found'
php -c ~/etc/php.ini /home/[host_user]/[domain_foder]/yii migrate
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory'
php -i | grep pdo
Answer the question
In order to leave comments, you need to log in
On hosting at RU-Center, the MySql server host looks like this: user.mysql , not localhost
error in the absence of PDO. Enable mysql_pdo in the settings, if you use mysql,
theoretically it can be connected for web PDO, but not for the console, a separate config
Didn’t work with the console on Ru-Center, but in shared hosting PDO was initially disabled, but it turns on in 2 clicks, you have apparently a dedicated server, I won’t point a finger for sure, but I need to find where to turn it on
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question