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?
Advertisement
Answer
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.