当前位置 博文首页 > 好习惯成就伟大:Ubuntu系统下安装MantisBT
MantisBT是一个开放源代码问题追踪器,它在简单和强大之间提供了一种微妙的平衡。
官网:?https://www.mantisbt.org/
Ubuntu14.04下的默认源是PHP5.0,需要添加外部源
apt-get install software-properties-common add-apt-repository ppa:ondrej/php apt-get update apt-get install php7.0整合PHP和MYSQL?
apt-get install php7.0-mysql
1.mysql账号密码
mysql -uroot -p
2.设置创建mantisbt用户
GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugtracker.* TO mantisbt@localhost IDENTIFIED BY 'password';3.刷新权限
FLUSH PRIVILEGES;
4.创建数据库
CREATE DATABASE bugtracker;5.退出
quit
整合PHP和Apache
apt-get install libapache2-mod-php7.0 /etc/init.d/apache2 restart1.编辑apache主配置文件/etc/apache2/apache2.conf,修改KeepAlive设置
KeepAlive Off
2.Apache默认的multi-processing模块(MPM ) 是一个event 模块,但是 php默认是使用 prefork模块,禁用event模块,启用prefork模块
a2dismod mpm_event
a2enmod mpm_prefork下载安装PHPMailer
1.下载地址https://github.com/PHPMailer/PHPMailer
2.解压到mantisbt/library中改名为phpmailer
3.mantisbt/library/phpmailer根目录新建文件composer.json
{ "require": { "phpmailer/phpmailer": "^6.0" } }4.下载安装composer
Step 1:进入安装目录
cd /usr/local/bin
Step 2:下载并安装
curl -s https://getcomposer.org/installer | sudo php
Step 3:添加执行权限
chmod a+x composer.phar
Step 4:加入全局命令
mv composer.phar /usr/local/bin/composer
Step 5:查看版本号
composer --version
5.在mantisbt/library/phpmailer根目录
composer require phpmailer/phpmailer
接下来就会下载PHPMailer,出现少git和zip和unzip命令
6.安装git
apt-get install git
7.安装zip和unzip
apt-get install zip unzip
8.重新运行
composer require phpmailer/phpmailer
9.在mantisbt/config/config.ini.php中指定PHPMailer
$g_use_phpMailer = ON;
$g_phpMailer_path = './library/phpmailer/';出现的问题
PHP mbstring extension is not enabled.
FATAL ERROR: PHP mbstring extension is not enabled. MantisBT requires this extension for Unicode (UTF-8) support http://www.php.net/manual/en/mbstring.installation.phpEDIT: 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:apt-get install php7.0-mbstring
重启apache2
service apache2 restart
邮件发送失败
2018-05-15 07:58:48 SMTP NOTICE: EOF caught while checking if connected SMTP Error: Could not authenticate. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 2018-05-15 07:58:48 SERVER -> CLIENT:在mantisbt/config/config.ini.php
$g_phpMailer_method = PHPMAILER_METHOD_SMTP; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL $g_smtp_host = 'smtp.qq.com'; # used with PHPMAILER_METHOD_SMTP $g_smtp_port = '587'; $g_smtp_username = 'xxx@qq.com'; # used with PHPMAILER_METHOD_SMTP $g_smtp_password = 'password'; # used with PHPMAILER_METHOD_SMTP $g_administrator_email = 'xxx@qq.com'; $g_webmaster_email = 'xxx@qq.com'; $g_from_email = 'xxx@qq.com'; # the "From: " field in emails $g_return_path_email = 'xxx@qq.com'; # the return address for bounced mail $g_from_name = 'Mantis Bug Tracker'; $g_use_phpMailer = ON; $g_phpMailer_path = './library/phpmailer/'; $g_email_receive_own = OFF; $g_email_send_using_cronjob = OFF; $g_smtp_connection_mode = 'tls'; # Can be 'ssl' or 'tls' $g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT; $g_log_destination = '/opt/email.log';测试PHPMailer
用来测试PHPMailer是否可用
use \; date_default_timezone_set('Etc/UTC'); require 'library/phpmailer/vendor/autoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Host = 'smtp.qq.com'; $mail->SMTPSecure = 'tls'; $mail->SMTPAutoTLS = false; $mail->Port = 587; $mail->SMTPAuth = true; $mail->Username = 'xxxx@qq.com'; $mail->Password = 'password'; $mail->setFrom('xxx@qq.com', 'First Last'); $mail->addReplyTo('xxx@qq.com', 'First Last'); $mail->addAddress('xxxx@qq.com', 'John Doe'); $mail->Subject = 'PHPMailer SMTP test'; $mail->Body = 'This is a plain-text message body ___'; if (!$mail->send()) { echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message sent!'; }
相关主题
- https://www.mantisbt.org/?, MantisBT官网
- https://github.com/PHPMailer/PHPMailer?, PHPMailer下载
- https://askubuntu.com/questions/491629/how-to-install-php-mbstring-extension-in-ubuntu
下一篇:没有了
最新 更多<<
好习惯成就伟大:Ubuntu系统下安装MantisBT 好习惯成就伟大:MantisBT的安装配置及使用 好习惯成就伟大:Brendan Gregg: 一个实战派大神 好习惯成就伟大:解决国内Stack Overflow访问慢的问题 好习惯成就伟大:【VSCode】VsCode找不到类型为 “cppdbg“ 的调 好习惯成就伟大:商密圈大咖齐聚北京 共商国密开源未来发展方向 好习惯成就伟大:什么是虚拟化 好习惯成就伟大:密钥管理系统介绍 好习惯成就伟大:国家密码管理局公告(第41号) 好习惯成就伟大:英文文献 ---英语词汇整理 好习惯成就伟大:华为海思AI视频监控芯片出货量超5亿,背后竟然 流年的博客:C++语言篇 字符串及字符数组练习 RunningOnMyWay的博客:nodejs实现微信app支付-创建订单与签名部 RunningOnMyWay的博客:nodejs实现微信支付成功后-异步通知验签 RunningOnMyWay的博客:nodejs实现支付宝app支付-异步通知结果验 RunningOnMyWay的博客:Python3基础学习----数组列表list RunningOnMyWay的博客:Python3基础学习----元组 RunningOnMyWay的博客:Python3基础学习----字符与字符串 RunningOnMyWay的博客:Python3基础学习----字典 RunningOnMyWay的博客:H5 contentEditable 创建可编辑区域 除了死亡所有的离开都是背叛 - 关于坚强的个性签名男生精选 我居然输给了让你哭的人 - 失恋的伤感qq个性签名男生 扯淡的人生彪悍的扯淡 - 犀利超拽的qq个性签名男生专属 承蒙时光不弃感谢一切给予 - 励志的个性签名适合男生比较成熟 赶快迷恋哥趁哥还不是传说 - 霸气超拽的男生个性签名大全2016 成熟的第一步是习惯孤独 - 成熟男人QQ个性签名最新版 不喜多愁善感却又害怕孤独 - 最孤独的个性签名男生伤心版 谎言注定要付出代价 - 吸引人的悲伤QQ签名男生最新版 我很会说话但我不会主动 - 男生个性签名淡漠2016最新版的 谁也不能把谁的疼痛感同深受 - 心痛的男生扣扣个性签名大全