Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start php-fpm - "cannot get uid for user 'apache'"

Tags:

linux

php

nginx

On a fresh AWS Linux HVM box, I ran the commands:

sudo yum update
sudo yum install git nginx php-fpm

I then tried to sudo service start php-fpm, but got the error:

Starting php-fpm: [10-Sep-2014 20:52:39] ERROR: [pool www] cannot get uid for user 'apache'
[10-Sep-2014 20:52:39] ERROR: FPM initialization failed

Where am I going wrong and where is the apache user coming from?

like image 991
Jonathan Avatar asked Sep 10 '14 20:09

Jonathan


1 Answers

The apache user comes from php-fpm.conf file. It does not matter that you run it as root, the service will start as the user which is configured in this file.

Find your php-fpm.conf file. It should be somwhere in /etc. Edit it and change lines

user = apache
group = apache

to

user = www-data
group = www-data

I'm assuming your default nginx configuration also uses the www-data user.

like image 184
Maciej Sz Avatar answered Oct 11 '22 13:10

Maciej Sz