【问题标题】:Why am I getting the error "Class PDO not found" in this situation?为什么在这种情况下我会收到错误“找不到类 PDO”?
【发布时间】:2011-09-15 00:16:22
【问题描述】:

即使我已安装 PDO 并将其包含在我的 php.ini 中,我仍然收到以下错误。

我可能会遗漏什么?我正在使用学说和代码点火器

<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">

<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message:  Doctrine\ORM\Query\ParameterTypeInferer::inferType() [<a href='doctrine\orm\query\parametertypeinferer.infertype'>doctrine\orm\query\parametertypeinferer.infertype</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead</p>
<p>Filename: Query/ParameterTypeInferer.php</p>
<p>Line Number: 70</p>

</div><br />
<b>Fatal error</b>:  Class 'PDO' not found in <b>/home/mrwongs/public_html/engine/application/third_party/Doctrine/ORM/Query/ParameterTypeInferer.php</b> on line <b>70</b><br />

我的phpinfo可以在:http://173.203.85.196/test.php看到

在我的 php.ini 中有以下两行:

extension=pdo.so
extension=pdo_mysql.so

【问题讨论】:

  • 你确定运行 php 的代码实际上是在使用你展示给我们的 php.ini 吗?
  • 执行phpinfo(); 并查看输出说明您当前设置使用的配置文件。
  • 最安全的检查方式是if(!extension_loaded('pdo')) die ('Oops!');
  • @Jon 有趣的是,PDO 似乎已加载。所以现在看来​​ Doctrine 找不到了。
  • 您是否尝试过解决时区设置以查看是否是导致问题的警告?

标签: php apache doctrine pdo


【解决方案1】:

您是否在网页上收到此错误?还是从 cli 运行?

php-cli 可能使用了不同的 php.ini

【讨论】:

    【解决方案2】:

    重新启动 apache 服务器。如果你还没有这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-01-17
      • 1970-01-01
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 2011-07-05
      • 1970-01-01
      相关资源
      最近更新 更多