环境:
apache_2.0.59-win32-x86-no_ssl.msi
php-5.1.6-Win32
mysql-5.0.18-win32.zip
PHPMailer_v5.0.2
Mantis:
mantisbt-1.2.4
1.配置PHP
PHP文件夹放在C盘根目录下(放在其它目录也可以),将php.ini-dist重命名为php.ini,打开php.ini编辑:
(1)extension_dir = "./"改为extension_dir = "c:/php/ext"
(2);extension=php_mbstring.dll去掉前面的分号
(3);extension=php_mysql.dll去掉前面的分号
(4);session.save_path = "/tmp"改为session.save_path ="C:/windows/temp"
(5)加入环境变量:c:/php和c:/php/ext
2.配置apache
对于httpd.conf文件,在未尾加上以下行
#PHP 5
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
#php.ini的路径
PHPIniDir "C:/php"
(20150731)注意:如果是安装包是httpd-2.2.25-win32-x86-no_ssl.msi,上面的配置应改为
LoadModule php5_module "c:/php/php5apache2_2.dll"
<IfModule mod_php5.c>
PHPINIDir "c:/php"
AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
</IfModule>
3.mySql安装
1)安装时,遇到复选框□skip sign-up,记得勾选。
2)遇到有standard的选项,勾选。
3)遇到□Include Bin,勾选。
4)密码设置为root。
5)为了使用方便,可以考虑再安装一个图形化管理工具,这里我推荐使用mysql-gui-tools-5.0-r11a-win32.msi。
6)如果服务器上启用了防火墙,那么需要在防火墙设置中添加一个例外端口,如端口号为3306。
4.安装mantis
(1)将mantisbt-1.2.4复制到Web服务器的htdocs目录下,更名mantis。
(2)创建Mysql数据库mantis,命令:mysql> create database mantis;
(3) 修改root帐号的密码。这个步骤主要是因为4.1版本后的MySQL使用了基于不同的密码算法的认证协议。如果服务器更新了版本,但是客户端API没有相应更新,就会出现认证失败的情况。这个情况可以通过执行以下sql语句来解决。
mysql> update mysql.user set password = OLD_PASSWORD('root') where host = 'localhost' and user = 'root';
mysql> flush privileges;
(4)为Mantis创建用户并赋予权限
mysql> use mantis;
Mantis用户名/密码:mantis:
mysql> grant select,insert,update,alter,index,create,delete,drop on Mantis.* to mantis@"%" identified by "mantis";
mysql> grant select,insert,update,delete,index,drop,create,alter on Mantis.* to mantis@"localhost" identified by "mantis";
mysql> update mysql.user set password = OLD_PASSWORD('mantis') where host = 'localhost' and user = 'mantis';
mysql> flush privileges;
(5)将config_inc.php.sample改成config_inc.php,并打开修改:
$g_hostname = 'localhost';
$g_db_username = 'mantisdbuser';
$g_db_password = '';
$g_database_name = 'bugtracker';
$g_db_type = 'mysql';
改成:
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'mantis';
$g_db_username = 'mantis';
$g_db_password = 'mantis';
在文件未尾加上支持中文和禁止邮件通知的语句
$g_default_language = 'chinese_simplified';
$g_enable_email_notification = OFF;
(6)安装Mantis
在浏览器中输入:http://localhost:8080/mantis/admin/install.php,可以登陆mantis安装目录。
admin用户名/密码:root
mantis的用户名/密码:mantis
根据提示生成数据库的表和基本数据
(7)登陆mantis
在浏览器中输入:http://localhost/mantis/login.php
(8)让MANTIS支持发邮件
a.下载PHPMailer_v5.0.2
b.将PHPMailer_v5.0.2放到C:/PHP目录下
c.在PHP.INI上加上一行 include_path="C:/php/PHPMailer_v5.0.2"
d.将mantis下的文件config_inc.php的# --- Email Configuration ---下的内容全部注释
然后加上以下内容
# --- email variables -------------
$g_send_reset_password=OFF;
$g_enable_email_notification= ON;
$g_use_phpMailer = ON;
$g_phpMailer_path = 'c:/php/PHPMailer_v5.0.2/';
$g_phpMailer_method = 2;
$g_smtp_host = '邮件服务器';
$g_smtp_username = '登陆名';
$g_smtp_password = '登陆密码';
# --- email variables -------------
$g_administrator_email = 'test@test.cn';
$g_webmaster_email = 'test@test.cn';
# the "From: " field in emails
$g_from_email= 'test@test.cn';