zoukankan      html  css  js  c++  java
  • PDO drivers no value in Windows

    学习php编程遇到 

    Uncaught exception 'PDOException' with message 'could not find driver'  

    或者 

    Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

    整两个问题,网上找了很多资料,很多是这样解决的

    配置php.ini文件添加extension=php_pdo_mysql.dll,这样就开启pdomysql扩展库 

    但是我没有解决问题,问题还是老样子,后来在stackoverflow 找到了问题所在

    具体链接http://stackoverflow.com/questions/7086859/pdo-drivers-no-value-in-windows

    问题出在了

    extension_dir = "ext"
    改成绝对路径就可以了
    ; Directory in which the loadable extensions (modules) reside.
    ; http://php.net/extension-dir
    ; extension_dir = "./"
    ; On windows:
    extension_dir = "D:/php-5.4.11-Win32-VC9-x86/ext"
    原因

    in php.ini and php -m was starting fine and reporting that it loaded pdo_mysql, but when I ran phpinfo.php through apache, the driver was missing.

    I fixed it by changing the extension_dir to an absolute path. I'm guessing it got confused when running through Apache and made it relative to something else.  

    我固定它通过改变extension_dir绝对路径。我猜它混淆了运行时通过Apache和相对于别的东西。

    转载:http://blog.csdn.net/bao0682/article/details/46827111
  • 相关阅读:
    安装 Android 运行环境
    Sea.js
    css hack 兼容性
    solr全文检索基本原理
    Solr初步学习
    jquery中ajax的用法
    Javascript的模块化编程
    html 标签
    CSS盒子模型
    python 初学03 Eric+PyQt+python IDE与界面程序
  • 原文地址:https://www.cnblogs.com/cxscode/p/8371803.html
Copyright © 2011-2022 走看看