对于别人来说,这个问题可能看不出来什么,但对于我来说,充分说明还是没有好好对待这个问题,事实上,只要细心多考虑,有些看起来很大的问题,还是很好解决的。
今天通过disczu提供的程序,把phpwind的数据库转为了discuz,另外,火山主机提供了1G的免费空间服务,申请了以后,就把discuz论坛传了上去,但对方是单电信的空间,我这边网通上传数据时,真是慢得要命!并且,还有很多文件少传字节错误,真是很不方便。
论坛建立以后,在本地论坛备份好数据库,通过ftp也上传到空间上去,然后在空间上的论坛内通过恢复数据库来导入数据,但在导入后,导入的数据在论坛内总是显示乱码;这个问题,以前也讨论过,这是mysql编码不同的原因引起的,但具体怎么样方便的解决这个问题,一直没有找到好的方法;这次,又出现这个问题,我就跑到disczu论坛上再次找了一下问题的解决方法,想不到,真有高人!并且解决的方法也很简单。而且据我所考虑,phpwind的编码问题,应该以此类推,也可以解决。
使用前提:后台能够正常导入备份数据,但完成后出现乱码;(我的正好是这种情况)
方法:
以下编码是discuz的config.inc.php文件内容,覆盖原config.inc.php,重新安装论坛,再次导入输入,完成。
并且作者还论证说,以前几个论坛出现乱码我都是这么做的,并且成功!但不保证所有乱码使用此方法都可以成功。
<?php
/*
[Discuz!] (C)2001-2006 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$RCSfile: config.inc.php,v $
$Revision: 1.14.2.1 $
$Date: 2006/07/17 07:50:17 $
*/
// [EN] Set below parameters according to your account information provided by your hosting
// [CH] 以下变量请根据空间商提供的账号参数修改,如有疑问,请联系服务器提供商
$dbhost = 'localhost'; // database server
// 数据库服务器
$dbuser = 'dbuser'; // database username
// 数据库用户名
$dbpw = 'dbpasswd'; // database password
// 数据库密码
$dbname = 'dbname'; // database name
// 数据库名
$adminemail = 'admin@your.com'; // admin email
// 论坛系统 Email
$dbreport = 0; // send db error report? 1=yes
// 是否发送数据库错误报告? 0=否, 1=是
// [EN] If you have problems logging in Discuz!, then modify the following parameters, else please leave default
// [CH] 如您对 cookie 作用范围有特殊要求,或论坛登录不正常,请修改下面变量,否则请保持默认
$cookiedomain = ''; // cookie domain
// cookie 作用域
$cookiepath = '/'; // cookie path
// cookie 作用路径
// [EN] Special parameters, DO NOT modify these unless you are an expert in Discuz!
// [CH] 以下变量为特别选项,一般情况下没有必要修改
$headercharset = 1; // force outputing charset header
// 强制设置字符集,只乱码时使用
$errorreport = 1; // reporting php error, 0=only report to admins(safer), 1=report to all
// 是否报告 PHP 错误, 0=只报告给管理员和版主(更<a href="http://www.linwan.net.cn/catalog.asp?tags=%E5%AE%89%E5%85%A8">安全</a>),不报告钩子错误, 1=报告给任何人并报告钩子错误
$forcesecques = 0; // require security question for administrators' control panel, 0=off, 1=on
// 管理人员必须设置<a href="http://www.linwan.net.cn/catalog.asp?tags=%E5%AE%89%E5%85%A8">安全</a>提问才能进入系统设置, 0=否, 1=是
$onlinehold = 900; // time span of online recording
// 在线保持时间
$pconnect = 0; // persistent database connection, 0=off, 1=on
// 数据库持久连接 0=关闭, 1=打开
// [EN] !ATTENTION! Do NOT modify following after your board was settle down
// [CH] 论坛投入使用后不能修改的变量
$tablepre = 'cdb_'; // 表名前缀, 同一数据库安装多个论坛请修改此处
// table prefix, modify this when you are installingmore than 1 Discuz! in the same database.
$attachdir = './attachments'; // 附件保存位置 (服务器路径, 属性 777, 必须为 web 可访问到的目录, 不加 "/", 相对目录务必以 "./" 开头)
// attachments saving dir. (chmod to 777, visual web dir only, ending without slash
$attachurl = 'attachments'; // 附件路径 URL 地址 (可为当前 URL 下的相对地址或 http:// 开头的绝对地址, 不加 "/")
// [EN] !ATTENTION! Preservation or debugging for developing
// [CH] 切勿修改以下变量,仅供程序开发调试用!
$database = 'mysql'; // 'mysql' for MySQL version and 'pgsql' for PostgreSQL version
// MySQL 版本请设置 'mysql', PgSQL 版本请设置 'pgsql'
$charset = 'gbk'; // default character set, 'gbk', 'big5', 'utf-8' are available
// 论坛默认字符集, 可选 'gbk', 'big5', 'utf-8'
$dbcharset = 'latin1'; // default database character set, 'gbk', 'big5', 'utf8', 'latin1' and blank are available
// MySQL 字符集, 可选 'gbk', 'big5', 'utf8', 'latin1', 留空为按照论坛字符集设定
$attackevasive = 0; // protect against attacks via common request, 0=off, 1=cookie refresh limitation, 2=deny proxy request, 3=both
// 防护大量正常请求造成的拒绝服务攻击, 0=关闭, 1=cookie 刷新限制, 2=限制代理访问, 3=cookie+代理限制
$tplrefresh = 1; // auto check validation of templates, 0=off, 1=on
// 模板自动刷新开关 0=关闭, 1=打开
// ============================================================================






