0

I'm using a different user for my web services. Screw convention.

I don't have www-data set in any php config files:

$ grep -rnw /etc -e 'www-data'
$ 

But I'm still getting this error:

$ journalctl -u php7.0-fpm
php7.0-fpm-checkconf[19642]: chown: invalid user: ‘www-data:www-data’
systemd[1]: php7.0-fpm.service: Control process exited, code=exited status=1
systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
systemd[1]: php7.0-fpm.service: Unit entered failed state.
systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.
ki9
  • 1,243
  • 1
  • 13
  • 19

1 Answers1

0

I fixed this by first replacing www-data in /usr/lib/tmpfiles.d/php7.0-fpm.conf, which had looked like this:

#Type  Path   Mode  UID       GID       Age  Argument
    d  /run/php   0755  www-data  www-data  -    -

I then got another error:

systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...
php-fpm7.0[]: [] ERROR: failed to open error_log (/var/log/php7.0-fpm.log): Permission denied (13)
php-fpm7.0[]: [] ERROR: failed to post process the configuration
php-fpm7.0[]: [] ERROR: FPM initialization failed
systemd[1]: php7.0-fpm.service: Main process exited, code=exited, status=78/n/a
systemd[1]: Failed to start The PHP 7.0 FastCGI Process Manager.
systemd[1]: php7.0-fpm.service: Unit entered failed state.
systemd[1]: php7.0-fpm.service: Failed with result 'exit-code'.

Which I fixed by changing the group and permissions of the log file to my webserver user:

$ sudo chgrp mywebserveruser /var/log/php7.0-fpm.log                       
$ sudo chmod g+rw /var/log/php7.0-fpm.log

And finally restarting fpm:

$ sudo systemctl reload-or-restart
ki9
  • 1,243
  • 1
  • 13
  • 19