php_value php-fpm配置中的php_value的Env变量字符串不起作用
我有一个php-fpm配置文件,
php_flag[display_errors] = ${PHP_DISPLAY_ERRORS}
php_value[error_reporting] = ${PHP_ERROR_REPORTING}
php_flag[log_errors] = ${PHP_LOG_ERRORS}
并定义了env变量:
PHP_DISPLAY_ERRORS=1
PHP_ERROR_REPORTING=E_ALL
PHP_LOG_ERRORS=1
如果我评论php_value [error_reporting]
一切都按预期工作(屏幕上会显示错误),但是当未被调音时,工作。
正如我一直在播放的那样,我似乎可以使用ENV可通过可vairable Via设置任何布尔值,但不能以相同的方式设置字符串值。
我还尝试了各种引用字符串的形式,并使用php_admin_value没有运气。阿米缺少什么。
跑步:Apache,PHP 7.3,PHP-FPM,Docker
I have a php-fpm config file with:
php_flag[display_errors] = ${PHP_DISPLAY_ERRORS}
php_value[error_reporting] = ${PHP_ERROR_REPORTING}
php_flag[log_errors] = ${PHP_LOG_ERRORS}
and ENV variables defined:
PHP_DISPLAY_ERRORS=1
PHP_ERROR_REPORTING=E_ALL
PHP_LOG_ERRORS=1
If I comment out php_value[error_reporting]
everything works as expected (errors will be displayed on screen) but when un-commented, it doesn't work.
As I have been playing, it seems like I can set any boolean value using an ENV vairable via but cannot set string values in the same way.
I have also tried various forms of quoting the string and using php_admin_value with no luck. What amI missing.
Running: Apache, PHP 7.3, PHP-FPM, Docker
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您应该运行
并查看实际设置在运行容器中。
(当心,如果您尝试
echo $ php_error_reporting
它将返回空的env-var,因为没有入门点的外壳是sh
,而不是<<代码> bash )实际上应该是相反的:在Linux Shell脚本/扩展中,没有布尔类型,只有字符串。
首先尝试确保您的环境变量具有您期望的价值;然后从那里开始调试是否是FPM或INI文件的问题(尽管这不太可能)。
First you should run
and see what is actually set inside the running container.
(beware, if you try to
echo $PHP_ERROR_REPORTING
it will return empty env-var, because the shell with no entrypoint issh
, notbash
)Actually should be the opposite: in Linux shell scripts/expansion there's no Boolean type, just Strings.
Try first to ensure that you environment variables have the value that you expect; then proceed from there in debugging whether is a problem with FPM or the INI file (although that's quite unlikely).