Phorge 2026.27 Ubuntu 22.04 安装指南

在 Ubuntu 22.04.5 LTS 上以 Nginx + PHP 8.1 + MySQL 8.0 从零安装 Phorge 2026.27,含在线与离线两种方案、systemd 托管、首次登录及 7 条实测排障记录。

PhorgePHPPHP 应用项目管理工单系统2026/10/28

Phorge 2026.27 Ubuntu 22.04 安装指南

目标:在 Ubuntu 22.04.5 LTS 上从零部署一套可登录、可用的 Phorge 2026.27(Nginx + PHP 8.1 + MySQL 8.0),覆盖在线安装与离线安装两种方案、systemd 托管、首次登录与真实排障过程。文中命令与回显均来自 2026-10-28 的实测环境,路径为 /var/www/phorge、端口为 8138。

一、环境信息

先把实测环境固定下来,后续所有路径、版本号、端口都可以在读者机器上逐项对照。

项目实测值
操作系统Ubuntu 22.04.5 LTS(x86_64)
Phorge2026.27(GitHub 标签 2026.27,发布页时间 2026-06-30)
PHP8.1.2-1ubuntu2.28(php8.1-fpm / php8.1-cli)
数据库MySQL 8.0.46-0ubuntu0.22.04.4
Web 服务器Nginx 1.18.0 (Ubuntu)
Node.js12.22.9(仅 aphlict 通知服务需要)
源码目录/var/www/phorge
附属依赖目录/var/www/arcanist
附件目录/var/www/phorge-files
站点端口8138
站点地址http://192.168.1.100:8138

php -v 与 mysql --version 的真实回显:

php -v | head -1
mysql --version
nginx -v
node -v
PHP 8.1.2-1ubuntu2.28 (cli) (built: Oct 19 2026 18:54:45) (NTS)
mysql  Ver 8.0.46-0ubuntu0.22.04.4 for Linux on x86_64 ((Ubuntu))
nginx version: nginx/1.18.0 (Ubuntu)
v12.22.9

💡 说明:Phorge 对 PHP 的要求是 8.1 及以上,Ubuntu 22.04 仓库自带 8.1,正好满足,不需要引入第三方 PHP 源。

二、前置条件

安装前先确认四件事,缺一项都会在后续步骤报错。

2.1 系统与资源

  • Ubuntu 22.04.x,root 或 sudo 权限;
  • 内存 ≥ 2GB(守护进程 + PHP-FPM + MySQL 的最低可用配置),磁盘 ≥ 20GB;
  • 服务器时间正确,后续 bin/storage upgrade 的补丁时间戳依赖系统时间;
  • 防火墙放行 8138/TCP(Web)与 22280/TCP(aphlict,可选)。

2.2 端口占用检查

ss -ltn | grep -E ':8138|:22280|:22281'

预期结果:无输出(表示端口空闲)。若有输出,先停掉占用进程或改用其他端口,并同步修改 Nginx 与 phabricator.base-uri。

2.3 PHP 扩展清单

Phorge 依赖 mysqli、mbstring、iconv、curl、gd、zip、xml、intl 等扩展。安装完成后用下面的命令核对:

php -m | tr '\n' ' '

实测回显:

[PHP Modules] calendar Core ctype curl date dom exif FFI fileinfo filter ftp gd gettext hash iconv intl json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib  [Zend Modules] Zend OPcache

2.4 源码依赖关系

Phorge 的 bin/* 脚本依赖同级的 Arcanist 库,目录结构必须是「arcanist/ 与 phorge/ 并列」:

/var/www/
├── arcanist/
└── phorge/

⚠️ 注意:只下载 Phorge 源码、不放 arcanist 时,任何 bin/ 命令都会直接失败。真实报错与修复见第九章 9.1。

三、版本选型说明

3.1 版本号怎么读

Phorge 用「年份.周序号」打标签,2026.27 表示 2026 年内的发布点 27。它的发版并不频繁,近三年每年 2–4 个发布点,因此安装时优先选 GitHub 上最新的标签,而不是等某个「LTS」。截至 2026-10-28,Releases 页面最新条目标签为 2026.27,发布时间 2026-06-30。

3.2 本次选择

选项取值理由
Phorge2026.27当前最新稳定标签
Arcanist2026.27与 Phorge 同标签,避免接口不匹配
PHP8.1(系统包)Ubuntu 22.04 自带,兼容性最好
数据库MySQL 8.0官方主推;MariaDB 需自行验证
Web 服务器Nginx配置轻、静态资源性能好;Apache 亦可

3.3 获取源码与校验

mkdir -p /opt/src
cd /opt/src
curl -LO https://github.com/phorgeit/phorge/archive/refs/tags/2026.27.tar.gz
curl -LO https://github.com/phorgeit/arcanist/archive/refs/tags/2026.27.tar.gz
sha256sum phorge-2026.27.tar.gz arcanist-2026.27.tar.gz

实测回显:

10a8ca31a0d1b08dd77744fdad8a3cfeeccc1a4c5eb4972ca8866a72e63a640a  phorge-2026.27.tar.gz
e3e6561a611a900be8fa8241e86139683a5b5ceec37e4496034876fe8f809ad9  arcanist-2026.27.tar.gz

⚠️ 网络说明:2026-10-28 实测 GitHub Releases Atom 直连返回空响应、API 触发限流,两个 tar 包经 HTTP 代理下载成功;读者若直连下载缓慢,可换用国内软件源或自行配置代理。两个文件的 SHA256 与上表一致即可继续。

四、安装方案 A:在线安装(APT 依赖 + 官方源码包)

这是推荐方案:依赖走系统包管理器,Phorge 走官方源码包,升级时只需要替换源码目录。

4.1 安装系统依赖

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y nginx php8.1-fpm php8.1-cli \
  php8.1-mysql php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-zip \
  php8.1-intl mysql-server git curl

实测尾部回显(输出节选):

Processing triggers for php8.1-cli (8.1.2-1ubuntu2.28) ...
Processing triggers for php8.1-fpm (8.1.2-1ubuntu2.28) ...
invoke-rc.d: policy-rc.d denied execution of restart.

invoke-rc.d ... denied 是无人值守安装环境跳过自动重启的正常提示,不影响安装结果,下一步手动启动即可。

4.2 启动并设为开机自启

systemctl enable mysql
systemctl start mysql
systemctl enable php8.1-fpm
systemctl start php8.1-fpm
systemctl enable nginx
systemctl start nginx
systemctl is-active mysql
systemctl is-active php8.1-fpm
systemctl is-active nginx

实测回显:

active
active
active

4.3 部署源码

mkdir -p /var/www
tar -xzf /opt/src/phorge-2026.27.tar.gz -C /var/www
mv /var/www/phorge-2026.27 /var/www/phorge
tar -xzf /opt/src/arcanist-2026.27.tar.gz -C /var/www
mv /var/www/arcanist-2026.27 /var/www/arcanist
chown -R www-data:www-data /var/www/phorge /var/www/arcanist
ls /var/www

实测回显:

arcanist  phorge

4.4 创建数据库与账号

mysql -e "CREATE DATABASE IF NOT EXISTS phabricator_meta_data CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -e "CREATE USER 'phorge'@'localhost' IDENTIFIED WITH mysql_native_password BY 'q1w2e3r4';"
mysql -e "GRANT ALL PRIVILEGES ON \`phabricator\\_%\`.* TO 'phorge'@'localhost'; FLUSH PRIVILEGES;"
mysql -e "SHOW GRANTS FOR phorge@localhost;"

实测回显:

Grants for phorge@localhost
GRANT USAGE ON *.* TO `phorge`@`localhost`
GRANT ALL PRIVILEGES ON `phabricator\_%`.* TO `phorge`@`localhost`

关键点:Phorge 会按应用创建几十个 phabricator_* 库,所以必须授予通配库权限,只授权单个库会在 bin/storage upgrade 时直接失败(真实报错见 9.2)。

4.5 写入基础配置

cd /var/www/phorge
bin/config set mysql.host localhost
bin/config set mysql.port 3306
bin/config set mysql.user phorge
bin/config set mysql.pass q1w2e3r4
bin/config set phabricator.base-uri 'http://192.168.1.100:8138'
bin/config set phabricator.timezone Asia/Shanghai
mkdir -p /var/www/phorge-files
chown www-data:www-data /var/www/phorge-files
bin/config set storage.local-disk.path /var/www/phorge-files
cat conf/local/local.json

实测回显:

 DONE  Wrote configuration key "mysql.host" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "mysql.port" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "mysql.user" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "mysql.pass" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "phabricator.base-uri" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "phabricator.timezone" to local storage (in file "conf/local/local.json").
 DONE  Wrote configuration key "storage.local-disk.path" to local storage (in file "conf/local/local.json").
{
  "storage.local-disk.path": "/var/www/phorge-files",
  "phabricator.timezone": "Asia/Shanghai",
  "phabricator.base-uri": "http://192.168.1.100:8138",
  "mysql.pass": "q1w2e3r4",
  "mysql.user": "phorge",
  "mysql.port": "3306",
  "mysql.host": "localhost"
}

每个键的作用:

键作用说明
mysql.host / port / user / pass连接 MySQL不建议用 root 账号,单独建 phorge 用户
phabricator.base-uri站点对外地址必须与浏览器地址完全一致,否则首页 500
phabricator.timezone默认时区影响界面显示与日志时间
storage.local-disk.path附件落盘目录必须对 www-data 可写

4.6 初始化数据库结构

cd /var/www/phorge
bin/storage upgrade --force

实测输出(首尾节选):

Loading quickstart template onto "localhost:3306"...
Applying patch "phabricator:00.application.0.db" to host "localhost:3306"...
Applying patch "phabricator:00.pastebin.0.db" to host "localhost:3306"...
Applying patch "phabricator:00.system.0.db" to host "localhost:3306"...
Applying patch "phabricator:20140129.dashboard.0.db" to host "localhost:3306"...
...
Completed applying all schema adjustments.
 ANALYZE  Analyzing tables...
 ANALYZED  Analyzed 500 tables.

验证数据库确实建好:

mysql -e 'SHOW DATABASES' | grep -c phabricator_
bin/storage databases | tail -8

实测回显:

56
phabricator_dashboard
phabricator_almanac
phabricator_multimeter
phabricator_spaces
phabricator_badges
phabricator_phurl
phabricator_packages
phabricator_paste

共 56 个 phabricator_* 库、500 张表。bin/storage status 会逐条列出已应用的补丁,共 1561 行(含 historical 与 worker 两类补丁)。

4.7 配置 Nginx 站点

新建 /etc/nginx/sites-available/phorge.conf:

server {
    listen 8138;
    server_name phorge.example.com;

    root /var/www/phorge/webroot;
    index index.php;

    location / {
        rewrite ^/(.*)$ /index.php?__path__=/$1 last;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

启用站点并检查语法:

rm -f /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/phorge.conf /etc/nginx/sites-enabled/phorge.conf
nginx -t
systemctl reload nginx

实测回显:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

⚠️ 注意:重写目标必须写成 __path__=/$1(带前导斜杠)。写成 __path__=$1 时首页会返回 500 与 Request parameter '__path__' is set, but empty,真实排障见 9.3。

4.8 验证 Web 入口

curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: 192.168.1.100:8138' http://127.0.0.1:8138/

实测回显(新装、尚未注册账号时):

302 http://192.168.1.100:8138/auth/register/

302 跳到注册页说明重写规则、PHP-FPM、base-uri 三者已经对齐。注册首个账号后同一地址返回 200 首页。

五、安装方案 B:离线源码安装(断网环境)

内网服务器无法访问外网时,用一台可联网的同版本 Ubuntu 22.04 机器准备离线包,再拷贝进去。

5.1 在线机准备 APT 离线包

mkdir -p /opt/offline/debs
cd /opt/offline/debs
apt-get install --download-only -y nginx php8.1-fpm php8.1-cli php8.1-mysql \
  php8.1-curl php8.1-gd php8.1-mbstring php8.1-xml php8.1-zip php8.1-intl \
  mysql-server curl
cp /var/cache/apt/archives/*.deb /opt/offline/debs/
ls /opt/offline/debs | wc -l

预期结果:/opt/offline/debs 下出现 nginx、php8.1、mysql-server 及其依赖的 .deb,数量通常在 60–100 个之间(随系统已装包情况浮动)。

5.2 离线机安装

把 /opt/offline 与两个源码 tar 包拷贝到目标机后执行:

cd /opt/offline/debs
dpkg -i *.deb
apt-get -f install -y
systemctl enable mysql
systemctl start mysql
systemctl enable php8.1-fpm
systemctl start php8.1-fpm
systemctl enable nginx
systemctl start nginx
systemctl is-active mysql
systemctl is-active php8.1-fpm
systemctl is-active nginx

预期结果:dpkg 逐包安装完成,systemctl is-active 三个服务均为 active。若依赖顺序报错,执行一次 apt-get -f install -y 补齐。

5.3 部署源码与配置

源码解压、Arcanist 并列、数据库授权、bin/config set、bin/storage upgrade、Nginx 配置与方案 A 的 4.3–4.7 完全一致,直接照做即可。

⚠️ 说明:方案 B 的 apt-get --download-only 与 dpkg -i 流程未在本次实测环境执行(本次实测走在线安装),上述为按 Ubuntu 22.04 包管理行为给出的标准命令与预期结果;离线包必须与目标机同为 amd64/Ubuntu 22.04,否则会出现依赖版本冲突。

5.4 方案 B 的额外依赖

bin/aphlict 需要 Node.js。离线环境需额外准备 nodejs、npm 的 deb,并在源码目录预置 ws 模块:

cd /var/www/phorge/support/aphlict/server
npm install ws --registry=https://registry.npmmirror.com

预期结果:added 1 package,目录下出现 node_modules/ws。

六、方案对比与选择建议

维度方案 A:在线安装方案 B:离线安装
联网要求安装期需要外网仅准备阶段需要外网
依赖来源Ubuntu 官方仓库同版本机器的 APT 缓存
安装耗时约 3–5 分钟(依赖已缓存时更快)取决于拷贝与 dpkg 解包,通常 5–10 分钟
版本一致性跟随仓库最新补丁与准备机完全一致,可复现性最好
升级方式apt upgrade + 替换源码重新准备离线包
适用场景可联网的测试/生产环境内网隔离、等保场景

选择建议:能联网就用方案 A;内网隔离用方案 B,并额外准备 Node.js 与 ws 模块,否则实时通知不可用。

七、配置说明

7.1 PHP-FPM

默认池 /etc/php/8.1/fpm/pool.d/www.conf 以 www-data 运行,监听 /run/php/php8.1-fpm.sock,与 Nginx 配置里的 fastcgi_pass 对应。小团队可直接使用默认值;若并发较高,调整:

; /etc/php/8.1/fpm/pool.d/www.conf
pm = dynamic
pm.max_children = 20
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 8

修改后 systemctl reload php8.1-fpm,用 systemctl status php8.1-fpm 确认 active (running)。

7.2 MySQL

Phorge 的库全部使用 utf8mb4,建议在 /etc/mysql/mysql.conf.d/mysqld.cnf 确认字符集与 InnoDB 参数:

[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_buffer_pool_size = 1G
max_connections = 200

innodb_buffer_pool_size 按物理内存的 50%–70% 设置;示例 1G 适用于 2GB 内存的入门机器。改完 systemctl restart mysql,用 mysql -e 'SHOW VARIABLES LIKE "character_set_server";' 验证。

7.3 Phorge 应用层配置

conf/local/local.json 是 bin/config set 的落盘结果,所有覆盖配置都在这里,不要手工改 conf/default.conf.php。常用键:

键示例值用途
phabricator.base-urihttp://192.168.1.100:8138站点地址,必须与外网访问一致
phabricator.timezoneAsia/Shanghai默认时区
storage.local-disk.path/var/www/phorge-files附件目录
notification.servers见 7.4实时通知服务地址
security.require-httpsfalse未上 TLS 时保持 false

7.4 实时通知(aphlict)

先写通知服务配置,再启动:

cd /var/www/phorge
bin/config set notification.servers '[{"type":"client","host":"192.168.1.100","port":22280,"protocol":"http"},{"type":"admin","host":"127.0.0.1","port":22281,"protocol":"http"}]'
mkdir -p /var/tmp/aphlict /var/log
chown -R www-data:www-data /var/tmp/aphlict

notification.servers 的 client 项是浏览器连接地址,admin 项只给服务器本机管理用;协议填 http 时对应 WebSocket 的 ws://。

7.5 守护进程

cd /var/www/phorge
runuser -u www-data -- ./bin/phd start

实测回显:

Freeing active task leases...
Freed 0 task leases.
Launching daemons:
(Logs will appear in "/var/tmp/phd/log/daemons.log".)

    (Pool: 1) PhabricatorRepositoryPullLocalDaemon
    (Pool: 1) PhabricatorTriggerDaemon
    (Pool: 1) PhabricatorFactDaemon
    (Pool: 4) PhabricatorTaskmasterDaemon

Done.

⚠️ 注意:bin/phd、bin/aphlict 都拒绝以 root 运行,必须切到 www-data(或其他非 root 账号)。

八、systemd 托管与首次登录

8.1 phd 的 systemd 单元

新建 /etc/systemd/system/phorge-phd.service:

[Unit]
Description=Phorge daemons (phd)
After=network.target mysql.service
Wants=mysql.service

[Service]
Type=forking
User=www-data
Group=www-data
WorkingDirectory=/var/www/phorge
ExecStart=/var/www/phorge/bin/phd start
ExecStop=/var/www/phorge/bin/phd stop
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

8.2 aphlict 的 systemd 单元

新建 /etc/systemd/system/phorge-aphlict.service:

[Unit]
Description=Phorge notification server (aphlict)
After=network.target phorge-phd.service

[Service]
Type=forking
User=www-data
Group=www-data
WorkingDirectory=/var/www/phorge
ExecStart=/var/www/phorge/bin/aphlict start
ExecStop=/var/www/phorge/bin/aphlict stop
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

启用并验证:

systemctl daemon-reload
systemctl enable phorge-phd
systemctl start phorge-phd
systemctl enable phorge-aphlict
systemctl start phorge-aphlict
systemctl is-active phorge-phd
systemctl is-active phorge-aphlict

实测回显:

active
active

bin/aphlict status 与端口监听:

cd /var/www/phorge
bin/aphlict status
ss -ltn | grep -E '2228[01]'

实测回显:

Reading configuration from: <phorge>/conf/aphlict/aphlict.default.json
Aphlict (20533) is running.
LISTEN 0      511          0.0.0.0:22280      0.0.0.0:*
LISTEN 0      511        127.0.0.1:22281      0.0.0.0:*

8.3 首次注册管理员

浏览器访问 http://192.168.1.100:8138/auth/register/,填写用户名、真实姓名、邮箱与密码。首个账号会自动成为管理员;若界面显示「Wait For Approval」,用 CLI 审批并提权:

cd /var/www/phorge
bin/user approve --user root
bin/user empower --user root

实测回显:

 DONE  Approved user account "root".
 DONE  Empowered user account "root".

然后回到登录页 http://192.168.1.100:8138/auth/login/,用 root / q1w2e3r4 登录。

⚠️ 注意:演示口令 q1w2e3r4 命中 Phorge 内置弱口令字典(externals/wordlist/password.lst 第 2083 行),注册时会提示 The selected password is very weak。仅演示环境可临时删除该行后再注册(sed -i '/^q1w2e3r4$/d' externals/wordlist/password.lst);生产环境请保留字典校验,改用满足策略的强口令。

8.4 登录验证

登录成功后访问首页,页面标题与账号菜单可确认身份:

curl -s -H 'Host: 192.168.1.100:8138' http://127.0.0.1:8138/auth/login/ | grep -oE '<title>[^<]*'

实测回显:

<title>Login

登录后的会话首页返回 200,右上角账号菜单出现 root,即表示 bin/phd、数据库、会话三者均正常。

九、常见问题

9.1 所有 bin 命令报 Arcanist 缺失

现象:

FATAL ERROR: Unable to load the "Arcanist" library. Put "arcanist/" next to "phorge/" on disk.

原因:只解压了 Phorge,没有同级的 arcanist 目录。

解决:按 4.3 下载并解压 arcanist-2026.27.tar.gz 到 /var/www/arcanist,保持 /var/www/arcanist 与 /var/www/phorge 并列。

9.2 storage upgrade 报 1044 权限不足

现象:

EXCEPTION: (Exception) Failed while trying to read schema status: the database "phabricator_meta_data" exists, but the current user ("phorge") does not have permission to access it.
(AphrontAccessDeniedQueryException) #1044: Access denied for user 'phorge'@'localhost' to database 'phabricator_meta_data'

原因:只给 phorge 用户授予了单个库权限,而 Phorge 还需要创建并访问其他 phabricator_* 库。

解决:补授通配库权限后重跑:

mysql -e "GRANT ALL PRIVILEGES ON \`phabricator\\_%\`.* TO 'phorge'@'localhost'; FLUSH PRIVILEGES;"
cd /var/www/phorge
bin/storage upgrade --force

9.3 首页 500,提示 path 为空

现象:

Request parameter '__path__' is set, but empty. Your rewrite rules are not configured correctly. The '__path__' should always begin with a '/'.

原因:Nginx 重写规则写成了 rewrite ^/(.*)$ /index.php?__path__=$1 last;,丢掉了前导斜杠。

解决:改为 rewrite ^/(.*)$ /index.php?__path__=/$1 last;,然后 nginx -t && systemctl reload nginx。

9.4 首页 500,提示 Site Not Found

现象:浏览器显示 Site Not Found,HTTP 500;而用 127.0.0.1 访问正常。

原因:phabricator.base-uri 与实际访问的 Host 不一致。本次实测把 base-uri 设为 http://192.168.1.100:8138,用 Host: 127.0.0.1:8138 访问时就会触发。

解决:统一域名与端口,或补设 phabricator.allowed-uris:

cd /var/www/phorge
bin/config set phabricator.allowed-uris '["http://127.0.0.1:8138"]'

9.5 aphlict 启动失败:目录不可写

现象:

EXCEPTION: (FilesystemException) Requested path '/var/tmp/aphlict/pid' is not writable.

原因:/var/tmp/aphlict 不存在或属主不是 www-data。

解决:

mkdir -p /var/tmp/aphlict
chown -R www-data:www-data /var/tmp/aphlict
cd /var/www/phorge
runuser -u www-data -- ./bin/aphlict start

9.6 aphlict 启动失败:缺少 ws 模块

现象:

Error: You need to install the Node.js "ws" module for websocket support.
Error: Cannot find module 'ws'

原因:只装了 Node.js,没有装 ws 依赖。

解决:

apt-get install -y npm
cd /var/www/phorge/support/aphlict/server
npm install ws --registry=https://registry.npmmirror.com
runuser -u www-data -- /var/www/phorge/bin/aphlict start

9.7 注册提示密码太弱

现象:The selected password is very weak: it is one of the most common passwords in use. Choose a stronger password.

原因:Phorge 内置常见口令字典,q1w2e3r4 在列表中。

解决:生产环境换强口令;演示环境可按 8.3 的提示临时移除该行。

十、卸载与清理

按「停服务 → 删站点 → 删库 → 删源码」的顺序执行,避免残留守护进程继续写库。

systemctl stop phorge-aphlict
systemctl disable phorge-aphlict
systemctl stop phorge-phd
systemctl disable phorge-phd
systemctl stop nginx
systemctl disable nginx
systemctl stop php8.1-fpm
systemctl disable php8.1-fpm
rm -f /etc/systemd/system/phorge-phd.service
rm -f /etc/systemd/system/phorge-aphlict.service
rm -f /etc/nginx/sites-enabled/phorge.conf
rm -f /etc/nginx/sites-available/phorge.conf
systemctl daemon-reload

删除数据库与账号:

mysql -N -e "SELECT GROUP_CONCAT(CONCAT('DROP DATABASE IF EXISTS \`', schema_name, '\`;') SEPARATOR ' ') FROM information_schema.schemata WHERE schema_name LIKE 'phabricator_%'" > /tmp/drop-phorge.sql
mysql < /tmp/drop-phorge.sql
mysql -e "DROP USER IF EXISTS 'phorge'@'localhost';"

删除源码与附件:

rm -rf /var/www/phorge /var/www/arcanist /var/www/phorge-files
rm -rf /var/tmp/phd /var/tmp/aphlict

验证:mysql -e 'SHOW DATABASES' | grep -c phabricator_ 应为 0,systemctl list-unit-files | grep phorge 无输出。

十一、参考链接