错误:未定义的类常量'MYSQL_ATTR_USE_BUFFERED_QUERY'

时间:2018-09-04 09:41:15

标签: php mysql drupal drupal-8

目前,我收到这种消息,但不知道如何解决。

命令php -m告诉我PDO和pdo_mysql在那里。

我在Ubuntu 18.04.1 LTS上将Drupal-8与php7.1.20结合使用

  

[2018年9月4日星期二09:27:48.210064] [php7:notice] [pid 2183] [客户端   10.56.99.1:53758]错误:未定义的类常量'MYSQL_ATTR_USE_BUFFERED_QUERY'在   /var/www/dev/web/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php   在第134#0行   /var/www/dev/web/core/lib/Drupal/Core/Database/Database.php(376):   Drupal \ Core \ Database \ Driver \ mysql \ Connection :: open(Array)\ n#1   /var/www/dev/web/core/lib/Drupal/Core/Database/Database.php(166):   Drupal \ Core \ Database \ Database :: openConnection('default',   'default')\ n#2 [内部功能]:   Drupal \ Core \ Database \ Database :: getConnection('default')\ n#3   /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(79):   call_user_func_array('Drupal \\ Core \\ Dat ...',数组)\ n#4   /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171):   Drupal \ Component \ DependencyInjection \ PhpArrayContainer-> createService(Array,   '数据库')\ n#5   /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(260):   Drupal \ Component \ DependencyInjection \ Container-> get('database',   1)\ n#6   /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php(62):   Drupal \ Component \ DependencyInjection \ PhpArrayContainer-> resolveServicesAndParameters(Array)\ n#7   /var/www/dev/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171):   Drupal \ Component \ DependencyInjection \ PhpArrayContainer-> createService(Array,   'cache.container')\ n#8   /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(516):   Drupal \ Component \ DependencyInjection \ Container-> get('cache.container')\ n#9   /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(877):   Drupal \ Core \ DrupalKernel-> getCachedContainerDefinition()\ n#10   /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(469):   Drupal \ Core \ DrupalKernel-> initializeContainer()\ n#11   /var/www/dev/web/core/lib/Drupal/Core/DrupalKernel.php(665):   Drupal \ Core \ DrupalKernel-> boot()\ n#12   /var/www/dev/web/index.php(19):   Drupal \ Core \ DrupalKernel-> handle(Object(Symfony \ Component \ HttpFoundation \ Request))\ n#13   {main}

1 个答案:

答案 0 :(得分:1)

Nvm。

apt-get install php-mysql和一个简单的service apache2 restart已解决了该错误。