Home > Backend Development > PHP Tutorial > tp3.2.3 上传到服务器就出错 本地测试正常`

tp3.2.3 上传到服务器就出错 本地测试正常`

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:33:53
Original
1671 people have browsed it

Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

PHP Version 5.3.17
extension=php_pdo_mysql.dll 也是开放的。

本地测试正常
上传到服务器就出错
3.2.3

//'配置项'=>'配置值'
'DB_TYPE'=>'mysql', //设置数据库类型
'DB_HOST'=>'locahost,//设置主机
'DB_NAME'=>'chidata',//设置数据库名
'DB_USER'=>'user', //设置用户名
'DB_PWD'=>'password', //设置密码
'DB_PORT'=>'3306', //设置端口号
'DB_PREFIX'=>'chi_', //设置表前缀[b][/b]

回复内容:

Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

PHP Version 5.3.17
extension=php_pdo_mysql.dll 也是开放的。

本地测试正常
上传到服务器就出错
3.2.3

//'配置项'=>'配置值'
'DB_TYPE'=>'mysql', //设置数据库类型
'DB_HOST'=>'locahost,//设置主机
'DB_NAME'=>'chidata',//设置数据库名
'DB_USER'=>'user', //设置用户名
'DB_PWD'=>'password', //设置密码
'DB_PORT'=>'3306', //设置端口号
'DB_PREFIX'=>'chi_', //设置表前缀[b][/b]

tp3.2对php版本有要求。PHP5.3以上版本(注意:PHP5.3dev版本和PHP6均不支持)

看看php里 php_mysql这个扩展是否打开了?

此乃php5.3的一个bug;
一个变通的解决办法是直接使用其整型值1002 (PDO::MYSQL_ATTR_INIT_COMMAND=1002)

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Why thinkphp has better performance than laravel?
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
thinkphp versions supported by php6
From 1970-01-01 08:00:00
0
0
0
thinkphp upload files
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template