在php-fpm.conf中插入一个变量。

huangapple go评论62阅读模式
英文:

Inserting a variable in php-fpm.conf

问题

I'd like to add the date to the name of my slow log file (to make like a rotating log).

我想将date添加到我的慢日志文件的名称中(以实现日志轮换的效果)。

I can't find a way to do it like this in my php-fpm.conf. The server doesn't restart with the date. Is this even possible to accomplish this way?

我找不到在我的php-fpm.conf中以这种方式执行的方法。服务器不会使用日期重新启动。这种方式是否可能实现?

date = $(date +"%Y-%m-%d")
slowlog = /var/www/html/perf/slow-$date.log
request_slowlog_timeout = 3s
英文:

I'd like to add the date to the name of my slow log file (to make like a rotating log).

I can't find a way to do it like this in my php-fpm.conf. The server doesn't restart with the date. Is this even possible to accomplish this way?

[www]
date = $(date +"%Y-%m-%d")
slowlog = /var/www/html/perf/slow-$date.log
request_slowlog_timeout = 3s

答案1

得分: 2

你不能将可变变量添加到php-fpm.conf中,它不是一个PHP文件,基本上是一个文本文件。

英文:

You can't add changeable variables to php-fpm.conf , it's not a PHP file, it's basically a text file

huangapple
  • 本文由 发表于 2023年8月4日 21:46:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76836540.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定