基于 drupal 的网站突然出现 pdo_mysql 错误?

发布于 2024-12-06 01:46:18 字数 651 浏览 2 评论 0原文

我的基于 drupal 的网站直到昨天都工作正常,但今天突然从哪里出现错误

Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /.../includes/database/mysql/database.inc on line 43

,从昨天开始我什至没有更改或更新任何内容,它突然从任何地方出现,在此之前它工作正常

在 database.inc 的第 43 行这是我写的,

 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,

我用谷歌搜索并得到一些想法,这是某种 PDO_MYSQL 错误,我不太清楚为什么这个错误突然出现

任何人都可以帮助我

其他信息

  • Linux Shared Webhosting
  • DRUPAL 7
  • Apache版本 2.2.20
  • PHP 版本 5.2.17
  • MySQL 版本 5.0.92-community-log
  • cPanel 版本 11.30.3(构建 5)

My drupal based website was working fine till yesterday but suddenly from no where today an error appeared

Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /.../includes/database/mysql/database.inc on line 43

I didn't even changed or updated anything since yesterday, it suddenly appears from no where, before that it was working fine

On line 43 of database.inc this was written

 PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,

I googled and got some idea that this is some sort of PDO_MYSQL error, i have not much idea why this error suddenly arrived

Can anyone please help me out

Additional information

  • Linux Shared Webhosting
  • DRUPAL 7
  • Apache version 2.2.20
  • PHP version 5.2.17
  • MySQL version 5.0.92-community-log
  • cPanel Version 11.30.3 (build 5)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

街道布景 2024-12-13 01:46:18

根据许多不同的来源,您的 PHP 安装中一定缺少 pdo_mysql 扩展。将其添加到 php.ini 中或要求您的托管提供商为您执行此操作。

链接:

他们都说同样的事情...安装 pdo_mysql 扩展。听起来您的托管提供商已禁用它!

According to a lot of different sources the pdo_mysql extension must be missing from your PHP installation. Either add it in php.ini or ask your hosting provider to do it for you.

Links:

They all say the same thing...install the pdo_mysql extension. Sounds like your hosting provider has disabled it!

挥剑断情 2024-12-13 01:46:18

这也可能是由于权限问题造成的。有时,考虑到使用 SuPHP 或其他配置,其中 apache(或其他服务器)用户无法运行文件,您会收到此类错误,并且 PDO_MYSQL: 将已安装并可运行。

如果您具有该框的 root 访问权限,请尝试执行 a

sudo php /path/to/your/php/script.php

或递归 chown 目录到适当的 apache 用户(通常是 apache 或 www-data)或文件所在主目录的用户(大多数共享服务器中的情况)。

chown -R apache:apache /path/to/web/files

This can also be due to a permissions issue. Sometimes, given the use of SuPHP or other configurations in which the apache (or other server) user can't run a file, you'll get this sort of error and PDO_MYSQL: will already be installed and operational.

If you have root access to the box, try doing a

sudo php /path/to/your/php/script.php

or recursively chown the directory to the appropriate apache user (usually apache or www-data) or the user who's home directory your files are resting in (the case in most shared servers).

chown -R apache:apache /path/to/web/files
泅渡 2024-12-13 01:46:18

我有完全相同的问题。我的网站突然瘫痪了。
我开始考虑按照上面的建议从 cPanel PHP PEAR 安装 php 扩展 php_pdo_mysql.dll,但这失败了。
我开始与我的主机 (Justhost) 进行实时聊天,结果发现他们已经升级了 php 版本。他们在 2 分钟内就把它修好了。

I had exactly the same problem. My site suddenly went down.
I started looking at installing php extension php_pdo_mysql.dll from cPanel PHP PEAR as suggested above, but this failed.
I started a live chat with my host (Justhost) and it tuned out they had upgraded their php version. They fixed it in 2 minues.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文