php-fpm在osx上获取其配置值的位置 [英] where is php-fpm getting its config values on osx
问题描述
我正在尝试通过运行以下命令在osx上进行php-fpm:
I'm trying to php-fpm on my osx by running:
php-fpm -t
我得到这个错误:
[30-Dec-2017 13:36:12] ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)
[30-Dec-2017 13:36:12] ERROR: failed to post process the configuration
[30-Dec-2017 13:36:12] ERROR: FPM initialization failed
我没有该文件,也无法创建它-即使使用sudo:
i don't have that file nor can I create it - even when using sudo:
$:/usr $ sudo mkdir var
Password:
mkdir: var: Operation not permitted
所以我的下一个大动作是找到在php-fpm配置中此日志文件目录的确切位置(以便我可以确定日志文件的位置).似乎有许多配置文件,所以我指的是
so my next big move is to find where exactly is this log file directory setup in php-fpm configuration (so that i can decide where the log file should go).. there seems to be many configuration files, so I refer to this question in finding the location of my php-fpm configuration file. so in the output of my php -i
file I have this:
'--sysconfdir=/usr/local/etc/php/7.1'
那里有以下文件:
// can't be coming from this file
// b/c this is telling me it's /usr/local/var/log/php-fpm.log
; If it's set to "syslog", log is sent to syslogd instead of being written
; into a local file.
; Note: the default prefix is /usr/local/var
; Default Value: log/php-fpm.log
那它是哪里来的?
当我运行此命令时:
which php-fpm
/usr/sbin/php-fpm
请注意是否有帮助
推荐答案
php-fpm.conf
的位置由选项确定
--sysconfdir=/path/to
在编译php-fpm之前调用 $ ./confugure
时指定.
specified when invoking $ ./confugure
just before compiling php-fpm.
通常是/etc
,但根据您的情况可能有所不同.
Usually it is /etc
but may be different in your case.
调用 $ php-fpm -i
将显示传递给 configure
的选项.
Invoking $ php-fpm -i
will show the options passed to configure
.
只需照顾 Configure Command =>
.
从评论中我看到您找到了'-sysconfdir =/private/etc'
,所以我会在那里查看.
From the comments I see you have found '--sysconfdir=/private/etc'
so I would look right there.
请注意,您可以使用 -y
选项调用php-fpm为配置文件指定其他位置.
Note that you can invoke php-fpm specifying a different location for the configuration file using the -y
option.
这篇关于php-fpm在osx上获取其配置值的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!