I’m trying to php-fpm on my osx by running:
php-fpm -t
and I get this error:
[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
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
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'
and there I have the following files:
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
so where is it coming from?
also when I run this:
which php-fpm /usr/sbin/php-fpm
note sure if it helps
Advertisement
Answer
php-fpm.conf
location is determined by the option
--sysconfdir=/path/to
specified when invoking $ ./confugure
just before compiling php-fpm.
Usually it is /etc
but may be different in your case.
Invoking $ php-fpm -i
will show the options passed to configure
.
Just look after Configure Command =>
.
From the comments I see you have found '--sysconfdir=/private/etc'
so I would look right there.
Note that you can invoke php-fpm specifying a different location for the configuration file using the -y
option.