2

while modify file etc/php-fpm.conf, if I open the option access.log = log/access.log, then php-fpm will test error.

➜  sbin  ./php-fpm -t

[26-May-2014 17:44:05] ERROR: failed to open access log (log/access.log): No such file or directory (2)

[26-May-2014 17:44:05] ERROR: failed to post process the configuration

[26-May-2014 17:44:05] ERROR: FPM initialization failed

I wonder it is I didn't set correct user and group, or other.

PS.

the error_log write success in var/log/php-fpm.log.

Thanks.

1 Answer 1

1

I have the impression you did not understand the difference between absolute and relative paths!

The file you modified probably is /etc/php-fpm.conf, not etc/php-fpm.conf. Note the leading slash (/), that makes a huge difference. The same things probably raises your issue: where is log/access.log meant to be located inside the file system? Relative to the processes working directory? Relative to the starting directory of the php interpreter? Where is that? You probably want to use /log/access.log instead if a folder /log exists (typical would be /var/log actually, but that depends on your system and setup). Again: note the leading slash!

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks. I know i edit the file etc/php-fpm.conf. that's correct. the question is I found 'log/access.log' is relative path, but the prefix I didn't know.
Sorry, I can't really follow you here. Again you confuse relative and absolute paths, I have the impression. Besides, access.log defines which log file to use. It only has to exist and be writable. touch and check its permissions.
enn. I found log/access.log default relative which I execute php-fpm. for example, when I run ./php-fpm -t in php-fpm/sbin/ path, it will run error. but run ./sbin/php-fpm -t in php-fpm/ path, it success...
All in all, thanks for your answers leading me to find the path problem.
I have to repeat: you did not understand what relative and absolute paths are and how they work. Looks like you think you do, but your replies do not really make sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.