Phorge 2026.27 配置参数详解

系统梳理 Phorge 2026.27 的配置体系:配置层级与优先级、bin/config 用法、155 个配置键分类、站点/数据库/存储/邮件/守护进程/搜索参数实测,以及两套生产配置模板。

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

Phorge 2026.27 配置参数详解

目标:把 Phorge 2026.27 的配置体系讲透——配置存在哪里、优先级如何、bin/config 怎么用、155 个合法配置键如何分类、站点/数据库/存储/邮件/守护进程/搜索六类核心参数怎么落值,并给出一份可直接套用的生产配置模板。文中命令与回显均来自 2026-10-28 的实测环境(Ubuntu 22.04.5 LTS、Phorge 2026.27、源码目录 /var/www/phorge、站点端口 8138)。

一、环境信息

项目实测值
操作系统Ubuntu 22.04.5 LTS(x86_64)
Phorge2026.27
PHP8.1.2-1ubuntu2.28(php8.1-fpm)
数据库MySQL 8.0.46-0ubuntu0.22.04.4
Web 服务器Nginx 1.18.0
源码目录/var/www/phorge
配置落盘文件/var/www/phorge/conf/local/local.json
默认配置目录/var/www/phorge/conf/
合法配置键数量155(bin/config list 实测行数)
站点地址http://192.168.1.100:8138
查询日期2026-10-28

Phorge 的配置只有两个来源会真正参与运行时决策:conf/local/local.json(本地覆盖)与数据库中的配置存储(Web 界面修改)。conf/default.conf.php 是内置默认值,不应手工编辑。

二、前置条件

开始改配置前,确认以下四项,否则会出现「命令执行成功但站点打不开」的假象。

2.1 服务已按安装流程跑通

bin/config、bin/storage、bin/phd 都是 Phorge 自带的 PHP 脚本,依赖同级的 Arcanist 目录:

ls /var/www

实测回显:

arcanist  phorge

若只有 phorge 没有 arcanist,任何 bin/* 命令都会报 Unable to load the "Arcanist" library。

2.2 配置文件必须对 www-data 可写

bin/config 以非 root 账号写入 conf/local/local.json。先用安装时的运行账号确认权限:

ls -l /var/www/phorge/conf/local/local.json

实测初始状态(root 身份写过配置后的错误状态):

-rw-r--r-- 1 root root 388 Oct 27 18:11 /var/www/phorge/conf/local/local.json

正确状态应为 www-data 属主、660 权限:

chown www-data:www-data /var/www/phorge/conf/local/local.json
chmod 660 /var/www/phorge/conf/local/local.json
ls -l /var/www/phorge/conf/local/local.json

实测回显:

-rw-rw---- 1 www-data www-data 388 Oct 27 18:11 /var/www/phorge/conf/local/local.json

2.3 数据库账号可用

mysql -u phorge -pq1w2e3r4 -e 'SHOW DATABASES' | grep -c phabricator_

实测回显:

56

2.4 改配置前先备份

mkdir -p /var/backups/phorge
cp /var/www/phorge/conf/local/local.json /var/backups/phorge/local.json.20261028
ls -l /var/backups/phorge/

预期结果:出现 local.json.20261028 备份文件。配置误改导致站点 500 时,直接覆盖回去即可回滚。

三、参数查看与修改方式

3.1 配置层级与优先级

Phorge 的配置值有三个来源,运行时按「本地文件 → 数据库 → 内置默认」的顺序取值,前者覆盖后者。bin/config get 会把每个来源都列出来,用 source 与 status 字段区分:

cd /var/www/phorge
runuser -u www-data -- ./bin/config get phabricator.base-uri

实测回显:

{
  "config": [
    {
      "key": "phabricator.base-uri",
      "source": "local",
      "value": "http://192.168.1.100:8138",
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "phabricator.base-uri",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}
  • source: local 对应 conf/local/local.json,由 bin/config set/delete 维护,优先级最高;
  • source: database 对应 Web 界面「配置 → 设置」写入的值,适合不接触服务器的人改;
  • 两边都没设时取内置默认值,此时两项都是 status: unset、value: null。

💡 说明:同一键同时存在 local 与 database 时,local 生效。排查「界面改了没反应」时,先看 bin/config get 里 local 是否已经占了同一个键。

3.2 列出与查看:list / get

bin/config list 输出全部合法键名,每行一个,顺序按字母排列。实测总数与开头部分:

runuser -u www-data -- ./bin/config list | wc -l
runuser -u www-data -- ./bin/config list | head -25

实测回显:

155
account.editable
account.minimum-password-length
amazon-ec2.access-key
amazon-ec2.secret-key
amazon-s3.access-key
amazon-s3.endpoint
amazon-s3.region
amazon-s3.secret-key
asana.project-ids
asana.workspace-id
audit.can-author-close-audit
auth.email-domains
auth.lock-config
auth.require-approval
auth.require-email-verification
bugtraq.logregex
bugtraq.url
cluster.addresses
cluster.databases
cluster.instance
cluster.mailers
cluster.read-only
cluster.search
config.hide
config.ignore-issues

get 只接受 list 里出现过的键名,返回 JSON 结构(见 3.1)。取一个未设置的键可以看到 unset 形态:

runuser -u www-data -- ./bin/config get phd.taskmasters

实测回显:

{
  "config": [
    {
      "key": "phd.taskmasters",
      "source": "local",
      "value": null,
      "status": "unset",
      "errorInfo": null
    },
    {
      "key": "phd.taskmasters",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

3.3 修改与删除:set / delete

set 的语法是 bin/config set key value,也可用 --stdin 从标准输入读值。以密码长度策略为例,完整走一遍设置、查看、删除:

cd /var/www/phorge
runuser -u www-data -- ./bin/config set account.minimum-password-length 10
runuser -u www-data -- ./bin/config get account.minimum-password-length
runuser -u www-data -- ./bin/config delete account.minimum-password-length

实测回显:

 DONE  Wrote configuration key "account.minimum-password-length" to local storage (in file "conf/local/local.json").
{
  "config": [
    {
      "key": "account.minimum-password-length",
      "source": "local",
      "value": 10,
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "account.minimum-password-length",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}
Deleted 'account.minimum-password-length' from local configuration.

--stdin 适合值里含空格或特殊字符的场景,但标准输入会被原样保存,不会做 JSON 解析:

printf '%s' '/var/www/phorge-files' | runuser -u www-data -- ./bin/config set storage.local-disk.path --stdin
runuser -u www-data -- ./bin/config get storage.local-disk.path

实测回显(stdin... 是命令原生输出,不是省略标记):

Reading value from stdin...
 DONE  Wrote configuration key "storage.local-disk.path" to local storage (in file "conf/local/local.json").
{
  "config": [
    {
      "key": "storage.local-disk.path",
      "source": "local",
      "value": "/var/www/phorge-files",
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "storage.local-disk.path",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

⚠️ 注意:不要写成 echo '"/var/www/phorge-files"' | runuser -u www-data -- ./bin/config set storage.local-disk.path --stdin,也不要在管道里用 echo 带换行。实测这两种写法会把引号和换行一起写进配置,get 的结果变成 "/var/www/phorge-files"\n,随后附件读写会失败。正确做法是 printf '%s' 且不加引号。出现该问题重新执行一次正确的 set 即可覆盖。

3.4 Web 界面修改与 migrate

登录后进入「配置 → 设置」也能改值,写入的是 database 来源。命令行侧还提供 migrate 工作流,用于把旧式基于文件的配置迁移到现代存储:

runuser -u www-data -- ./bin/config help

实测输出中的工作流清单:

      delete key
      Delete a local configuration value.

      done activity
      Mark a manual upgrade activity as complete.

      get key
      Get a local configuration value.

      help [command]
      Show this help, or workflow help for command.

      list
      List all configuration keys.

      migrate
      Migrate file-based configuration to more modern storage.

      set key value
      set key --stdin < value.json
      Set a local configuration value.

本环境全程使用 conf/local/local.json,不需要执行 migrate;只有从很老的 Phabricator 版本升级、且仍在 conf/ 下维护 .conf.php 文件时才需要。

3.5 修改后的生效方式

  • Web 请求读取配置是即时的,bin/config set 写入后刷新页面即可看到新值;
  • 守护进程(phd)在启动时读取 phd.* 类配置,改完必须重启,见 5.5;
  • 通知服务(aphlict)在启动时读取 notification.servers,改完同样要重启;
  • 修改 cluster.search 后需要重建索引,见 5.6。

四、参数总览

155 个键按前缀可分成 40 组,下表是按数量排序的实测统计(只列出现次数 ≥2 的前缀,其余单键组略):

前缀键数说明
metamta17邮件与回复处理
phabricator14站点级基础参数
differential10代码评审策略
maniphest7任务与工单策略
security6HTTPS、HMAC、出站黑名单
files6附件类型白名单
diffusion6代码仓库行为
cluster6集群、邮件、搜索服务
projects5项目字段与配色
log5访问日志与 SSH 日志
ui4Logo、页脚、主题色
storage4存储引擎与附件落盘
phd4守护进程
mysql4数据库连接
debug4调试开关
auth4注册、审批、邮箱验证
amazon-s34S3 存储后端
user3用户字段与实名要求
recaptcha3注册验证码
config3配置自检与隐藏

mysql.*、storage.*、phd.*、cluster.* 这四组是运维最常动的,后文逐一展开。

五、核心参数分类详解

5.1 站点与 URI 参数

phabricator.* 组决定站点对外身份,共 14 个键,常用的有:

键类型说明
phabricator.base-uri字符串站点主地址,必须与浏览器地址完全一致
phabricator.allowed-uris列表额外允许的访问地址(多域名、IP 直连)
phabricator.production-uri字符串生成邮件等绝对链接时使用的正式地址
phabricator.timezone字符串默认时区,影响界面与日志时间
phabricator.env字符串环境标识,用于区分测试/生产
phabricator.developer-mode布尔开发者模式,生产必须关闭
phabricator.uninstalled-applications列表停用不需要的应用
phabricator.cache-namespace字符串多套实例共用缓存时的命名空间隔离

设置主地址与时区(本环境实测值):

cd /var/www/phorge
runuser -u www-data -- ./bin/config set phabricator.base-uri 'http://192.168.1.100:8138'
runuser -u www-data -- ./bin/config set phabricator.timezone Asia/Shanghai

实测回显:

 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").

phabricator.base-uri 写错会直接导致 500 Site Not Found。若必须同时支持 IP 直连和域名访问,追加 allowed-uris:

runuser -u www-data -- ./bin/config set phabricator.allowed-uris '["http://127.0.0.1:8138"]'

💡 技术拓展:base-uri 与 production-uri 不是一回事。前者是「用户从哪个地址访问」,后者是「系统生成邮件链接、Webhook 回调时用哪个地址」。单机部署通常只设 base-uri;放在反向代理后、对外域名与内部访问地址不同时,才需要单独设 production-uri。

5.2 数据库与存储命名空间

mysql.* 只有 4 个键:mysql.host、mysql.port、mysql.user、mysql.pass。本环境实测值可通过 get 验证:

runuser -u www-data -- ./bin/config get mysql.host

实测回显:

{
  "config": [
    {
      "key": "mysql.host",
      "source": "local",
      "value": "localhost",
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "mysql.host",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

storage.default-namespace 决定这些库的前缀,默认即 phabricator。若同一台 MySQL 上要放第二套 Phorge,必须改命名空间,否则两套实例会抢同一批 phabricator_* 库:

runuser -u www-data -- ./bin/config get storage.default-namespace

预期结果:status: unset,即使用内置默认值 phabricator。改法示例(第二套实例使用):

runuser -u www-data -- ./bin/config set storage.default-namespace phorge2

⚠️ 注意:命名空间必须在首次执行 bin/storage upgrade 之前确定。已经有数据后再改,旧库不会被自动迁移,站点会表现为「所有数据消失」。

5.3 附件与文件存储

本地磁盘是默认存储后端,两个关键键:

键实测值说明
storage.local-disk.path/var/www/phorge-files附件落盘目录,必须对 www-data 可写
storage.mysql-engine.max-size未设置小于该值的附件可存 MySQL,默认内置值
storage.s3.bucket未设置启用 S3 时的桶名
amazon-s3.*未设置S3 的 key、secret、region、endpoint
runuser -u www-data -- ./bin/config get storage.local-disk.path

实测回显(配置修复后):

{
  "config": [
    {
      "key": "storage.local-disk.path",
      "source": "local",
      "value": "/var/www/phorge-files",
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "storage.local-disk.path",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

配套确认目录权限:

ls -ld /var/www/phorge-files

实测回显:

drwxr-xr-x 2 www-data www-data 4096 Oct 27 18:12 /var/www/phorge-files

5.4 邮件参数

metamta.* 共 17 个键,最常用的三个:

键说明
metamta.default-address系统发信人地址,缺省时邮件无法发出
metamta.reply-handler-domain收信回复域名,用于「回复邮件即评论」
metamta.one-mail-per-recipient是否每个收件人单独一封,默认 true

真正决定「邮件走哪个通道」的是 cluster.mailers,它的值是数组,每项包含 key(实例名)与 type(适配器类型)。本实验环境使用测试适配器,邮件只做格式校验、不会真正投递:

cd /var/www/phorge
runuser -u www-data -- ./bin/config set cluster.mailers '[{"key":"test","type":"test"}]'
runuser -u www-data -- ./bin/config get cluster.mailers

实测回显:

 DONE  Wrote configuration key "cluster.mailers" to local storage (in file "conf/local/local.json").
{
  "config": [
    {
      "key": "cluster.mailers",
      "source": "local",
      "value": [
        {
          "key": "test",
          "type": "test"
        }
      ],
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "cluster.mailers",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

生产环境换成 SMTP 适配器。源码 src/applications/metamta/adapter/PhabricatorMailSMTPAdapter.php 中 validateOptions 明确支持 host、port、user、password、protocol、message-id 六个选项:

runuser -u www-data -- ./bin/config set cluster.mailers '[{"key":"smtp","type":"smtp","host":"smtp.example.com","port":465,"user":"noreply@example.com","password":"smtp-password","protocol":"ssl"}]'
runuser -u www-data -- ./bin/config set metamta.default-address 'noreply@example.com'

⚠️ 注意:cluster.mailers 里的 SMTP 密码以明文写入 conf/local/local.json,该文件权限必须保持 660、属主 www-data,且不能纳入版本库或备份到公开位置。

5.5 守护进程参数

phd.* 共 4 个键:

键默认说明
phd.taskmasters内置 4任务处理进程池数量,决定后台任务并发
phd.log-directory/var/tmp/phd/log守护进程日志目录
phd.user未设置守护进程运行账号,未设置时按启动用户
phd.garbage-collection内置策略垃圾回收周期

phd.taskmasters 是唯一需要按负载调整的。实测把池数从默认 4 改为 2,重启后启动输出中的 Pool 值随之变化:

cd /var/www/phorge
runuser -u www-data -- ./bin/config set phd.taskmasters 2
systemctl stop phorge-phd
runuser -u www-data -- ./bin/phd start

实测回显(leases... 为命令原生输出,不是省略标记):

 DONE  Wrote configuration key "phd.taskmasters" to local storage (in file "conf/local/local.json").
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: 2) PhabricatorTaskmasterDaemon

Done.

恢复默认值并交还 systemd 托管:

runuser -u www-data -- ./bin/phd stop
runuser -u www-data -- ./bin/config delete phd.taskmasters
systemctl start phorge-phd
systemctl is-active phorge-phd

实测回显:

Deleted 'phd.taskmasters' from local configuration.
active

💡 说明:任务积压时优先加 phd.taskmasters(受 CPU 与 MySQL 连接数约束),不要盲目加机器。每增加一个 taskmaster 都会多占一条数据库连接。

5.6 搜索服务参数

cluster.search 定义全文检索服务,值是数组,每项由 type、hosts、roles 组成。未设置时 Phorge 使用内置 MySQL 全文索引,本环境实测就是这种形态:

cd /var/www/phorge
runuser -u www-data -- ./bin/search init

实测回显:

Initializing search service "MySQL".
Service index is already up to date.
Done.
No services need initialization.

源码内置文档 src/docs/user/cluster/cluster_search.diviner 给出了两种服务类型的标准写法。MySQL(默认,无需 host):

{
  "type": "mysql"
}

Elasticsearch(外置服务):

{
  "type": "elasticsearch",
  "hosts": [
    {
      "protocol": "http",
      "host": "127.0.0.1",
      "port": 9200
    }
  ]
}

写入形式(以 Elasticsearch 为例):

runuser -u www-data -- ./bin/config set cluster.search '[{"type":"elasticsearch","hosts":[{"protocol":"http","host":"127.0.0.1","port":9200}],"roles":{"read":true,"write":true}}]'

切换搜索服务后必须初始化并重建索引,命令来自同一份内置文档:

runuser -u www-data -- ./bin/search init
runuser -u www-data -- ./bin/search index --force --background --type all

⚠️ 注意:本环境没有部署 Elasticsearch,上述两条重建命令未实测执行;bin/search init 的实测输出见本节开头,确认默认 MySQL 服务可用。cluster.search 写入空数组 [] 也可以被接受(实测 status: set、value: []),表示不额外配置服务,运行时仍回落到默认 MySQL。

5.7 认证与安全参数

键本环境值说明
auth.require-approval未设置(默认开启)新注册账号是否需管理员审批
auth.require-email-verificationfalse实测已关闭,便于内网演示
auth.email-domains未设置限制可注册的邮箱域名
security.require-https未设置强制 HTTPS,上 TLS 后应开启
security.hmac-key未设置会话与签名密钥,生产建议显式指定
security.alternate-file-domain未设置附件独立域名,降低 XSS 风险

本环境关闭邮箱验证的实测命令与结果:

runuser -u www-data -- ./bin/config set auth.require-email-verification false
runuser -u www-data -- ./bin/config get auth.require-email-verification

实测回显:

 DONE  Wrote configuration key "auth.require-email-verification" to local storage (in file "conf/local/local.json").
{
  "config": [
    {
      "key": "auth.require-email-verification",
      "source": "local",
      "value": false,
      "status": "set",
      "errorInfo": null
    },
    {
      "key": "auth.require-email-verification",
      "source": "database",
      "value": null,
      "status": "unset",
      "errorInfo": null
    }
  ]
}

⚠️ 注意:该值是为内网演示环境的首次登录放行的,生产环境应删除该覆盖(bin/config delete auth.require-email-verification),恢复默认的邮箱验证。

六、生产配置模板

以下模板按两种常见规模给出,值均为可直接替换的实值。写入前先备份 local.json,写入后用 bin/config get 逐项复核。

6.1 小型团队:2 核 4GB 内存、100GB SSD、20 人以内

适用场景:单机部署、代码评审 + 任务管理为主、附件量不大。

{
  "mysql.host": "localhost",
  "mysql.port": "3306",
  "mysql.user": "phorge",
  "mysql.pass": "q1w2e3r4",
  "phabricator.base-uri": "https://phorge.example.com",
  "phabricator.timezone": "Asia/Shanghai",
  "storage.local-disk.path": "/var/www/phorge-files",
  "storage.default-namespace": "phabricator",
  "phd.taskmasters": 4,
  "auth.require-approval": true,
  "security.require-https": true,
  "security.hmac-key": "b7f3c1d94e2a8f6051c3d7e9a4b2f8c6",
  "metamta.default-address": "noreply@example.com",
  "cluster.mailers": [
    {
      "key": "smtp",
      "type": "smtp",
      "host": "smtp.example.com",
      "port": 465,
      "user": "noreply@example.com",
      "password": "smtp-password",
      "protocol": "ssl"
    }
  ]
}

要点:

  • innodb_buffer_pool_size 在 /etc/mysql/mysql.conf.d/mysqld.cnf 设为 1G,与 4GB 内存匹配;
  • PHP-FPM 的 pm.max_children 设为 20;
  • phd.taskmasters 保持 4,任务量大时再加到 6。

6.2 中型团队:8 核 16GB 内存、500GB NVMe、100 人以内

适用场景:代码仓库多、附件多、需要外置搜索与独立发信。

{
  "mysql.host": "127.0.0.1",
  "mysql.port": "3306",
  "mysql.user": "phorge",
  "mysql.pass": "q1w2e3r4",
  "phabricator.base-uri": "https://phorge.example.com",
  "phabricator.production-uri": "https://phorge.example.com",
  "phabricator.timezone": "Asia/Shanghai",
  "storage.local-disk.path": "/data/phorge-files",
  "storage.default-namespace": "phabricator",
  "storage.mysql-engine.max-size": 1048576,
  "phd.taskmasters": 8,
  "auth.require-approval": true,
  "auth.email-domains": ["example.com"],
  "security.require-https": true,
  "security.hmac-key": "9d2e5a7c4b1f8036e2c9a5d7f3b60814",
  "security.alternate-file-domain": "https://files.example.com",
  "metamta.default-address": "noreply@example.com",
  "metamta.reply-handler-domain": "phorge.example.com",
  "cluster.mailers": [
    {
      "key": "smtp",
      "type": "smtp",
      "host": "smtp.example.com",
      "port": 465,
      "user": "noreply@example.com",
      "password": "smtp-password",
      "protocol": "ssl"
    }
  ],
  "cluster.search": [
    {
      "type": "elasticsearch",
      "hosts": [
        {
          "protocol": "http",
          "host": "127.0.0.1",
          "port": 9200
        }
      ],
      "roles": {
        "read": true,
        "write": true
      }
    }
  ]
}

要点:

  • innodb_buffer_pool_size 设为 8G–10G,max_connections 提高到 300;
  • storage.mysql-engine.max-size 以字节计(1MB = 1048576),大于该值的附件落磁盘;
  • security.hmac-key、SMTP 密码、数据库密码属敏感值,local.json 权限保持 660;
  • 附件目录迁到独立数据盘 /data/phorge-files 时,先 chown -R www-data:www-data /data/phorge-files。

七、常见问题

7.1 报 local.json 不可写

现象:

Usage Exception: Local path "conf/local/local.json" is not writable. This file must be writable so that "bin/config" can store configuration.

原因:此前用 root 执行过 bin/config,文件属主变成 root,www-data 无法写入。

解决:

chown www-data:www-data /var/www/phorge/conf/local/local.json
chmod 660 /var/www/phorge/conf/local/local.json

7.2 报配置键未知

现象:

Usage Exception: Configuration key "no.such.key" is unknown. Use "bin/config list" to list all known keys.

原因:Phorge 会校验键名,拼错或用了已废弃的键都会被拒绝。

解决:bin/config list | grep <关键词> 找到正确键名。例如找通知相关键用 bin/config list | grep -i notification。

7.3 报值类型不匹配

现象:

Usage Exception: Value for option "account.minimum-password-length" must be an integer.

原因:该键要求整数,传了字符串 abc。

解决:按报错提示的类型重新赋值,如 bin/config set account.minimum-password-length 10。数组/字典类型要写成合法 JSON,且用单引号包裹整体。

7.4 set 成功但行为没变化

原因分两种:Web 侧参数下一次请求即生效;phd.*、notification.servers 由常驻进程在启动时读取,不重启不生效。

解决:改完 phd.taskmasters 或通知配置后重启对应服务:

systemctl restart phorge-phd
systemctl restart phorge-aphlict

再用 bin/config get 确认本地值已落盘,用 bin/phd start 的 Pool 输出确认实际生效值。

7.5 --stdin 把引号和换行写进了配置

现象:bin/config get storage.local-disk.path 的 value 变成 "/var/www/phorge-files"\n,附件上传报目录不存在。

原因:--stdin 原样保存标准输入,不剥离 JSON 引号与行尾换行。

解决:去掉引号、去掉换行重写一次:

printf '%s' '/var/www/phorge-files' | runuser -u www-data -- ./bin/config set storage.local-disk.path --stdin

7.6 改完 base-uri 首页 500 Site Not Found

原因:phabricator.base-uri 与实际访问的 Host 不一致。用 127.0.0.1 访问一个配置为 IP:8138 的站点就会触发。

解决:统一访问地址,或补设允许地址:

runuser -u www-data -- ./bin/config set phabricator.allowed-uris '["http://127.0.0.1:8138"]'

7.7 邮件发不出去

原因:cluster.mailers 仍是测试适配器(type: test),它只校验格式、不投递;或 metamta.default-address 未设置。

解决:按 5.4 换成 SMTP 适配器并设置发信人地址,然后用测试邮件功能验证。SMTP 参数填错时,错误会写入 phd 日志,查看 /var/tmp/phd/log/daemons.log。

7.8 切换搜索服务后搜不到数据

原因:新增检索服务后没有初始化、也没有重建索引。

解决:

runuser -u www-data -- ./bin/search init
runuser -u www-data -- ./bin/search index --force --background --type all

索引重建在后台执行,用 bin/phd log 观察进度;完成后在「配置 → 服务 → 搜索服务器」查看各主机健康状态。

八、参考链接