Question2Answer安装

Question2Answer的安装过程很简单,只需要几分钟的时间你就可以有一个强大的问答系统

安装要求

  • Web服务器(比如Apache)
  • PHP 4.3 或更高版本 (最好是PHP 5.x )
  • MySQL 4.1 或更高版本 (或 MySQL 5.x)

第一次安装(无SSO-单点登陆)

  • 下载最新版的Question2Answer,用winzip或其他工具解压(shell中的unzip命令)
  • 下载中文语言包,确保解压后的目录名是zh-cn,并将其放入qa-lang目录
  • 将解压的根目录中的qa-config-example.php重命名为qa-config.php
    用编辑器(推荐免费好用的Notepad++)打开qa-config.php填入相关的数据库信息
    1
    2
    3
    4
    5
    //多数情况下填写localhost 或 127.0.0.1即可
    define('QA_MYSQL_HOSTNAME', '这里填数据库服务器地址');
    define('QA_MYSQL_USERNAME', '这里填数据库用户名');
    define('QA_MYSQL_PASSWORD', '这里填数据库密码');
    define('QA_MYSQL_DATABASE', '这里填数据库名称');
  • 将所有的解压文件上传到服务器
  • 用浏览器打开你绑定的域名(如http://q2achina.sinaapp.com),根据页面的提示完成Question2Answer的安装

标签:Question2Answer, Question2Answer教程

已有 18 条评论

  1. q2afans q2afans

    原来那个中文插件也是你翻译的哦,期待下q2a越来越强大~~

    1. 现在关于Question2Answer中文的文档还很少,

      如果有兴趣,也可以贡献一些文章来和大家分享。

    2. 刘琪 刘琪

      我怎么没有找到模版目录 求解

  2. •下载中文语言包,确保解压后的目录名是zh-cn,并将其放入qa-lang目录

    目录名是zh

    另外数据库的用户名不能是 全权用户名 用 只读的就可以

    1. 只读的不行吧?

  3. likelike likelike

    请问楼主数据库究竟是什么啊?

    1. 就是你自己创建的数据库名字密码等信息啊

  4. 破系统 破系统

    下载完配置完打开浏览器显示。
    都没创建表,哪来qa_options。破系统
    PHP Question2Answer MySQL query error 1146: Table 'testt.qa_options' doesn't exist - Query: (SELECT 'options' AS selectkey, title, content FROM qa_options) UNION ALL (SELECT 'time', 'db_time', UNIX_TIMESTAMP(NOW()))

  5. guanghui7 guanghui7

    安装不成功 提示
    Question2Answer was unable to perform the installation query below. Please check the user in the config file has CREATE and ALTER permissions:

    CREATE TABLE qa_users (userid INT UNSIGNED NOT NULL AUTO_INCREMENT, created DATETIME NOT NULL, createip INT UNSIGNED NOT NULL, email VARCHAR(80) NOT NULL, handle VARCHAR(20) NOT NULL, avatarblobid BIGINT UNSIGNED, avatarwidth SMALLINT UNSIGNED, avatarheight SMALLINT UNSIGNED, passsalt BINARY(16), passcheck BINARY(20), level TINYINT UNSIGNED NOT NULL, loggedin DATETIME NOT NULL, loginip INT UNSIGNED NOT NULL, written DATETIME, writeip INT UNSIGNED, emailcode CHAR(8) CHARACTER SET ascii NOT NULL DEFAULT '', sessioncode CHAR(8) CHARACTER SET ascii NOT NULL DEFAULT '', sessionsource VARCHAR (16) CHARACTER SET ascii DEFAULT '', flags TINYINT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (userid), KEY email (email), KEY handle (handle), KEY level (level)) ENGINE=InnoDB CHARSET=utf8

    Error 1289: The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working

  6. The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working

    数据库权限有问题吧

  7. loethen loethen

    Warning: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in D:\xampp\htdocs\q2a\qa-include\qa-index.php on line 158

    Notice: ob_start(): failed to create buffer in D:\xampp\htdocs\q2a\qa-include\qa-index.php on line 158
    博主,请问下这个是什么问题?

  8. 51mxd 51mxd

    创建管理员账号的时候报错:
    Question2Answer query failed:

    (SELECT '0' AS selectkey, qa_categories.categoryid, qa_categories.parentid, qa_categories.title AS title, qa_categories.tags AS tags, qa_categories.qcount, qa_categories.position, NULL AS userid, NULL AS passsalt, NULL AS passcheck, NULL AS email, NULL AS level, NULL AS emailcode, NULL AS handle, NULL AS created, NULL AS sessioncode, NULL AS sessionsource, NULL AS flags, NULL AS loggedin, NULL AS loginip, NULL AS written, NULL AS writeip, NULL AS avatarblobid, NULL AS avatarwidth, NULL AS avatarheight, NULL AS points, NULL AS noticeid, NULL AS content, NULL AS format, NULL AS pageid, NULL AS permit, NULL AS nav, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_categories JOIN (SELECT NULL AS parentkey UNION SELECT grandparent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid JOIN qa_categories AS grandparent ON parent.parentid=grandparent.categoryid WHERE qa_categories.categoryid=NULL UNION SELECT parent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid WHERE qa_categories.categoryid=NULL UNION SELECT parentid FROM qa_categories WHERE categoryid=NULL UNION SELECT categoryid FROM qa_categories WHERE categoryid=NULL) y ON qa_categories.parentidparentkey ORDER BY qa_categories.position) UNION ALL (SELECT 'pending_loggedinuser', NULL, NULL, NULL, NULL, NULL, NULL, qa_users.userid, passsalt, HEX(passcheck), email, level, emailcode, handle, UNIX_TIMESTAMP(created), sessioncode, sessionsource, flags, UNIX_TIMESTAMP(loggedin), INET_NTOA(loginip), UNIX_TIMESTAMP(written), INET_NTOA(writeip), avatarblobid, avatarwidth, avatarheight, points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_users LEFT JOIN qa_userpoints ON qa_userpoints.userid=qa_users.userid WHERE qa_users.userid='1') UNION ALL (SELECT 'pending_notices', NULL, NULL, NULL, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, UNIX_TIMESTAMP(created), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, noticeid, content, format, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_usernotices WHERE userid='1' ORDER BY created) UNION ALL (SELECT 'pending_navpages', NULL, NULL, title, tags, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, permit+0, nav, heading, NULL, NULL FROM qa_pages WHERE nav IN ('B','M','O','F') ORDER BY position) UNION ALL (SELECT 'pending_widgets', NULL, NULL, title, tags, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, widgetid, place FROM qa_widgets ORDER BY position)

    Error 1267: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (ascii_general_ci,IMPLICIT) for operation 'UNION'

  9. 51mxd 51mxd

    安装成功后,无论访问首页还是后台都出错,提示

    Error 1267: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (ascii_general_ci,IMPLICIT) for operation 'UNION'

  10. 木子 木子

    配置后出现这样的情况
    Could not switch to the Question2Answer database. Please check the database name in the config file, and if necessary create the database in MySQL and grant appropriate user privileges.

  11. alon alon

    A Question2Answer database query failed when generating this page.

    A full description of the failure is available in the web server's error log file.
    新增完问题或者回答问题之后报错

    1. 数据库错误啊,是不是数据库配置不正确……

  12. 为什么我在本地安装,把汉化包放到lang文件夹没有实现汉化呢?还是英文版

    1. 需要在管理后台选择语言

添加新评论