BugFree 是淘寶開源的缺陷管理工具。官方提供 XAMPP 一鍵安裝,但若伺服器已預裝 Nginx/MySQL,手動整合更具彈性。以下記錄兩天半的踩坑與解決歷程。
./configure \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql \
...其他參數...
關鍵點:BugFree 需 PDO_MySQL 支援,必須加入 --with-pdo-mysql 並指定 MySQL 安裝路徑。
configure: error: Cannot find MySQL header files under yes.
原因:缺少 mysql-devel 開發套件。
yum install -y mysql-devel
安裝後重新 ./configure → make → make install,出現 "welcome to use php" 即成功。
編輯 nginx.conf 加入:
server {
listen 80;
server_name 192.168.1.101;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
rewrite ^([_0-9a-zA-Z-]+)?(/.*.php)$ $2 last;
rewrite ^ /bugfree/index.php last;
}
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
重啟 Nginx,啟動 php-fpm(如 /usr/local/sbin/php-fpm)。
index.php 呼叫 phpinfo(),確認 MySQL/PDO 模組載入html/bugfree手動部署雖繁瑣,卻能精確掌控各元件版本與配置,避免 XAMPP 的「黑盒」限制。