我正在尝试通过运行以下命令在我的 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 https://github.com/rlerdorf/php7dev/issues/48日志文件应该放在哪里)..似乎有很多配置文件,所以我参考这个问题 https://stackoverflow.com/a/35669139/766570找到我的 php-fpm 配置文件的位置。所以在我的输出中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.conf
位置由选项决定
--sysconfdir=/path/to
调用时指定$ ./confugure
就在编译 php-fpm 之前。
通常是/etc
但您的情况可能有所不同。
调用$ php-fpm -i
将显示传递给的选项configure
.
照顾一下Configure Command =>
.
从评论中我看到你发现了'--sysconfdir=/private/etc'
所以我会看那里。
请注意,您可以调用 php-fpm,并使用以下命令为配置文件指定不同的位置:-y
option.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)