[Fri Jan 23 16:46:09.947777 2026] [proxy_fcgi:error] [pid 317040:tid 140196473444096] [client 120.225.245.193:16550] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined function putenv() in /www/wwwroot/zabbix/include/gettextwrapper.inc.php:227\nStack trace:\n#0 /www/wwwroot/zabbix/include/classes/core/ZBase.php(505): setupLocale()\n#1 /www/wwwroot/zabbix/setup.php(118): ZBase->initLocales()\n#2 {main}\n thrown in /www/wwwroot/zabbix/include/gettextwrapper.inc.php on line 227’
PHP 8.2 的 putenv() 被禁用了
错误非常明确:
Fatal error: Call to undefined function putenv()
但注意一句话:
👉 putenv() 并不是“没编译”
👉 而是 被 disable_functions 禁用了
在环境里,这是默认“安全加固”行为。
为什么 Zabbix 会用到 putenv()?
在这里:
/www/wwwroot/zabbix/include/gettextwrapper.inc.php:227
Zabbix 在初始化语言环境时会:
设置 LANG
设置 LC_ALL
初始化 gettext
底层实现就是:
putenv(“LC_ALL=en_US.UTF-8”);
👉 只要 putenv() 被禁,Zabbix 前端一定炸
这不是 Bug,是 Zabbix 的正常行为。