【发布时间】:2017-12-30 11:50:29
【问题描述】:
我正在尝试在我的 osx 上运行 php-fpm:
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:
$:/usr $ sudo mkdir var
Password:
mkdir: var: Operation not permitted
所以我的下一个大动作是在 php-fpm 配置中找到这个日志文件目录设置的确切位置(这样我就可以decide 日志文件应该去哪里).. 似乎有很多配置文件,所以我在查找我的 php-fpm 配置文件的位置时参考了this question。所以在我的php -i 文件的输出中我有这个:
'--sysconfdir=/usr/local/etc/php/7.1'
我有以下文件:
php-fpm.conf
// 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 -i的输出说明了什么? (注:不是php -i) -
@MattGibson it 说
'--sysconfdir=/private/etc'.. 让我从这里拿走