Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Debian 7 64 as host, And i installed Lighttpd and PHP-FPM with mysql support, After fresh installation of lighttpd and PHP-FPM, I tried to enable user directories and i run following command:

root@x.x.x.x# lighty-enable-mod userdir

I got Ok messege after run above command but when i run below command to restart lighttpd, i got following output:

root@x.x.x.x# /etc/init.d/lighttpd force-reload
[FAIL] Reloading web server configuration: lighttpd failed!

I wants to open /home/user/www/project_name; when someone open my site; Like this way :, so I did following changes on /etc/lighttpd/conf-available/10-userdir.conf

## The userdir module provides a simple way to link user-based directories into
## the global namespace of the webserver.
# /usr/share/doc/lighttpd/userdir.txt

server.modules      += ( "mod_userdir" )

## the subdirectory of a user's home dir which should be accessible
## under http://$host/~$user
userdir.path         = "/www/project_name/public_html"

## The users whose home directories should not be accessible
userdir.exclude-user = ( "root", "postmaster" )

Following is the output of /var/log/lighttpd/error.log file.

2013-09-29 10:25:57: (log.c.166) server started 2013-09-29 10:44:57: (server.c.1430)     [note] graceful shutdown started 
2013-09-29 10:44:57: (log.c.166) server started 
2013-09-29 10:44:57:(mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied         
2013-09-29 10:44:57: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 
2013-09-29 10:44:57: (server.c.964) Configuration of plugins failed. Going down. 
2013-09-29 10:44:57: (server.c.1546) server stopped by UID = 0 PID = 5841 
2013-09-29 12:59:58: (log.c.166) server started 
2013-09-29 12:59:58: (mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied         
2013-09-29 12:59:58: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 
2013-09-29 12:59:58: (server.c.964) Configuration of plugins failed. Going down.

I cant fix problem and looking for solution.

share|improve this question
The error seems obvious. Did you read the error log entries that you posted? – Michael Hampton Sep 29 '13 at 13:40
Yeah i alreeady guess that its permission issue and i changed permission of php5-fpm.sock file to www-data but still same problem. – Pradeep Gupta Sep 29 '13 at 13:56
I also changed permission to file 0660 but nothing happened. – Pradeep Gupta Sep 29 '13 at 14:13
up vote 0 down vote accepted

lighttpd cannot write in /var/run, and binding to a unix socket always create a new file (changing permissions on a already existing one doesn't help).

/var/run is not /tmp - only root should be able to write. use a directory that is owned by lighttpd if you want lighttpd to create socket files (/tmp is also a bad idea!)

Also it looks like you're using php-fpm: you can't spawn php-fpm from lighttpd, remove the "bin-path" option. php-fpm is usually spawned through init scripts (or similar), and creates the sockets for each user it spawns php backends for (each user gets its own socket).

share|improve this answer
I Understand to create new directories owned by lighttpd, I think www-data is the user who has permission to write behalf of lighttpd, But i cant understand second para in which you describe php-fpm, can you elaborate this more? – Pradeep Gupta Sep 30 '13 at 9:44
removal of "bin-path" from 15-fastcgi-php.conf worked for me. However /var/run/php5-fpm.sock still work for me. Thanks by the way. – Pradeep Gupta Sep 30 '13 at 10:46
php-fpm runs as root, so it is able to create sockets in /var/run/. – Stefan Sep 30 '13 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.