thinkphp数据库配置文件在哪
2023-03-29 23:03:03
230
{{single.collect_count}}

满意答案

00e27ab806e4881f8254fe7ae8741834.png

lynnana

2016.11.09

00e27ab806e4881f8254fe7ae8741834.png

采纳率:40%    等级:10

已帮助:1768人

ThinkPHP\Common文件夹中的convention.php中是tp的核心配置文件,不能乱动,如果要想更改里面的专配置,在Conf 文件夹里面的config.php可以配置,可以这样写属

return array(

'DB_TYPE' => 'mysql',// 数据库类型

'DB_HOST' => '127.0.0.1',// 数据库服务器地址

'DB_NAME' => 'thinkphp',// 数据库名称

'DB_USER' => 'root',// 数据库用户名

'DB_PWD' => '123',// 数据库密码

'DB_PREFIX' => 'tp_',// 数据表前缀

'DB_CHARSET' => 'utf8',// 网站编码

'DB_PORT' => '3306',// 数据库端口

'APP_DEBUG' => false,// 开启调试模式

);

?>

也可以在最外边写,就是与ThinkPHP框架同一目录中写一个config.php文件,格式如同上面的一样,不过在Conf 文件夹里面的config.php中得包含最外边的那个config.php

00分享举报

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}