PHP Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

最近用ThinkPHP,给公司布置线上的网站的时候,遇到的一个问题,记录一下。

打开IE浏览器的设置,Internet选项里的高级,将”显示友好的HTTP错误消息“前都勾去掉!

再次刷新,看到的错误是:

PHP Fatal error: Undefined class constant ‘MYSQL_ATTR_INIT_COMMAND‘ in C:\inetpub\wwwroot\www\simplewind\Core\Library\Think\Db\Driver\Mysql.class.php on line 36

在这里可以看到,ThinkPHP使用的是PDO接口来访问MySQL数据库,但是PDO在php.ini配置默认是关闭的,

所以,开启php.ini配置中php_pdo_mysql.dll即可(去掉前面的;字符)

PHP Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

时间: 2024-07-30 22:08:24

PHP Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'的相关文章

Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in D:\phpStudy\http\obd\ThinkPHP\Li

Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in D:\phpStudy\http\obd\ThinkPHP\Li 很简单,只需要修改 php-ini  打开pdo扩展就可以了. extension=php_pdo_mysql.dll Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in D:\phpStudy\http\obd\Th

关于Thinkphp框架模型应用过程中出现的错误Undefined class constant MYSQL_ATTR_INIT_COMMAND

今天在用thinkphp框架做网站的时候,在调用model模型是意外发生Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]错误, 下面是我百度的结果,大部分说解决问题可以分为以下两类: 1. windows下iis7.5+php5.4.11(FastCGI) 缺少pdo,编辑php.ini 取消注释: extension=php_pdo_mysql.dll 重启iis PHP数据对象(PDO)扩

Ubuntu 13.10 PHP 5.5.x mcrypt missing – Fatal Error: Undefined function mcrypt_encrypt()!

[原文]http://www.tuicool.com/articles/goto?id=myM7veR I had updgraded my Ubuntu from 13.04 to 13.10 last week and everything went quite good. The only problems that I faced as developer are: Apache 2.4 was not working with default previous installation

Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

新下载的php3.23,本地访问数据库可以,服务器上不行.如下: :( Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' 错误位置 FILE: /usr/local/apache/htdocs/chesudiwx/ThinkPHP/Library/Think/Db/Driver/Mysql.class.php LINE: 36 ThinkPHP3.2.3 { Fast & Simple OOP PHP Framework } -- [ WE C

TP3 Undefined class constant ‘MYSQL_ATTR_INIT_C..

phpinfo();有个Configuration File (php.ini) 和Loaded Configuration File 后者优先级高于前者!如果后者为空则以前者为准:这才apache读取php.ini的位置,并不是读取php安装目录下的.Loaded Configuration File 这个值可以通过httpd.conf 的phpinidir这个参数修改 Thinkphp3.2中,在common的config.php配置连接mysql的常量但显示:Undefined class

PHP-问题处理Fatal error: Uncaught Error: Call to undefined function simplexml_load_file()

1.问题 今天重新安装了ubuntu,PHP,MySQL,Apache,到测试CMS项目时发生一个错误: Fatal error: Uncaught Error: Call to undefined function simplexml_load_file() 2.解决: 2.1 安装php-xml: sudo apt-get install php-xml 2.2重启apache服务: sudo service apache2 restart

Fatal error: Call to undefined function imagettftext()解决办法

Fatal error: Call to undefined function imagettftext()解决办法 我的问题是php编译安装时指定了gd的目录,其实不用指定.就可以了 博客分类: php freestylephpcmsconfigure  问题描述:phpcms 安装后,不能看到验证码图片. 解决:确保php-gd和freestyle.而且确保是先安装了freestyle,然后是php-gd:如果是先安装了php-gd,那么在安装完freestyle后,需要make clean

linux重新编译安装gd,增加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()

问题: Fatal error: Call to undefined function Think\imagettftext() in /var/www/webreg/ThinkPHP/Library/Think/Verify.class.php on line 143 查看phpinfo()后得知,gd中没有freetype的支持 解决: 首先安装freestyle,php-gd 确保先安装freestyle,然后是php-gd:如果是先安装了php-gd,那么在安装完freestyle后,需

PHP Fatal error: Call to undefined function mysql_pconnect()

[[email protected] caishenye]# tail -f /data/caishenye/sa_9_0.log PHP Warning:  mkdir(): No such file or directory in /data/caishenye/sa_9_0.php on line 18 PHP Fatal error:  Call to undefined function mysql_pconnect() in /data/caishenye/sa_9_0.php on