简介
MantisBT是一个开放源代码问题追踪器,它在简单和强大之间提供了一种微妙的平衡。
安装PHP7.0
Ubuntu14.04下的默认源是PHP5.0,需要添加外部源
1 | apt-get install software-properties-common |
整合PHP和MYSQL
1 | apt-get install php7.0-mysql |
1.mysql账号密码
1 | mysql -uroot -p |
2.设置创建mantisbt用户
1 | GRANT SELECT, INSERT, |
3.刷新权限
1 | FLUSH PRIVILEGES; |
4.创建数据库
1 | CREATE DATABASE bugtracker; |
5.退出
1 | quit |
整合PHP和Apache
1 | apt-get install libapache2-mod-php7.0 |
1.编辑apache主配置文件/etc/apache2/apache2.conf,修改KeepAlive设置
1 | KeepAlive Off |
2.Apache默认的multi-processing模块(MPM ) 是一个event 模块,但是 php默认是使用 prefork模块,禁用event模块,启用prefork模块
1 | a2dismod mpm_event |
下载安装PHPMailer
1.下载地址https://github.com/PHPMailer/PHPMailer
2.解压到mantisbt/library中改名为phpmailer
3.mantisbt/library/phpmailer根目录新建文件composer.json
1 | { |
4.下载安装composer
Step 1:进入安装目录
1
cd /usr/local/bin
Step 2:下载并安装
1
curl -s https://getcomposer.org/installer | sudo php
Step 3:添加执行权限
1
chmod a+x composer.phar
Step 4:加入全局命令
1
mv composer.phar /usr/local/bin/composer
Step 5:查看版本号
1
composer --version
5.在mantisbt/library/phpmailer根目录
1 | composer require phpmailer/phpmailer |
接下来就会下载PHPMailer,出现少git和zip和unzip命令
6.安装git
1 | apt-get install git |
7.安装zip和unzip
1 | apt-get install zip unzip |
8.重新运行
1 | composer require phpmailer/phpmailer |
9.在mantisbt/config/config.ini.php中指定PHPMailer
1 | $g_use_phpMailer = ON; |
出现的问题
PHP mbstring extension is not enabled.
1 | FATAL ERROR: PHP mbstring extension is not enabled. |
EDIT: Dylan Pierce has confirmed that you can already install some
PHP 7 extensions in the same way you would for PHP 5.
For mbstring in particular, you can execute:
1 | apt-get install php7.0-mbstring |
重启apache2
1 | service apache2 restart |
邮件发送失败
1 | 2018-05-15 07:58:48 SMTP NOTICE: EOF caught while checking if connected |
在mantisbt/config/config.ini.php
1 | # --- Email Configuration --- |
测试PHPMailer
用来测试PHPMailer是否可用
1 |
|