Take the 2-minute tour ×

Maybe i got the title wrong so correct me if it is

On system bootup i get the error

spawn-fcgi: opening PID-file '/var/run/php-fastcgi/php-fastcgi.pid' failed: Permission denied

What permission should i set php-fastcgi and what group/user is this being ran as? Would there be a problem if i simply use 777 (i get no errors and php works if i do this)

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The actual init scripts are run as root. However, they will usually switch to a specific user when executing a daemon.

If you look at the /etc/init.d/php-fastcgi you'll see a start-stop-daemon line in the start() function, which has a --chuid parameter. The parameter says what user the daemon will run as.

It is usually a variable, and so pulled from a config script. If this is ubuntu/debian, this will be /etc/default/php-fastcgi - look in there for a parameter with the same variable name as the chuid parameter. This is the user that needs to have write access to the pid file.

share|improve this answer
add comment

Your Answer


