5

I have installed FastCGI using yum, and edited my lighttpd.conf, but when restarting the server I receive this error.

2009-06-24 12:44:43: (log.c.97) server started 
2009-06-24 12:44:43: (mod_fastcgi.c.924) bind failed for: unix:/var/run/lighttpd/php-fastcgi.socket-0 No such file or directory 
2009-06-24 12:44:43: (mod_fastcgi.c.1365) [ERROR]: spawning fcgi failed. 
2009-06-24 12:44:43: (server.c.902) Configuration of plugins failed. Going down. 

The concerned part of my lighttpd.conf is:

fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                  #"socket" => "/var/run/lighttpd/php-fastcgi.socket",
                                  #"bin-path" => "/usr/bin/php-cgi"
                                   "socket" => "/tmp/php-fastcgi.socket",
                                   "bin-path" => "/usr/bin/php-cgi"
                                 )
                               )
                            )

Thanks ever so much.

Dave Cheney
  • 18,307
  • 7
  • 48
  • 56
James
  • 171
  • 1
  • 3
  • 15

6 Answers6

3

Check that lighttpd has permission to write to /var/run/lighttpd

Dave Cheney
  • 18,307
  • 7
  • 48
  • 56
2

Got Fixed with following changes:

  • mkdir /var/run/lighttpd
  • touch /var/run/lighttpd/php-fastcgi.socket
  • chown -R lighttpd:lighttpd /var/run/lighttpd

Where lighttpd is the username.

Updating socket in lighttpd.conf to point to /var/run/lighttpd/php-fastcgi.socket solves the problem.

unix:/var/run/lighttpd/php-fastcgi.socket-0 No such file or directory

dreamWalker
  • 121
  • 1
1

I was having the same problem with /var/run/lighttpd set owned by www-data by something instead of lighttpd user. I added the lighttpd user to the www-data group but apparently things still don't work sometimes, so I overrided the systemd service script with systemctl edit lighttpd:

/etc/systemd/system/lighttpd.service.d/override.conf
-----------------------------------------
[Unit]
Description=Lighttpd Daemon
After=network.target

[Service]
Type=simple
ExecStartPre=/bin/mkdir -p /var/log/lighttpd
ExecStartPre=/bin/chown lighttpd:lighttpd /var/log/lighttpd
ExecStartPre=/bin/mkdir -p /var/run/lighttpd
ExecStartPre=/bin/chown lighttpd:lighttpd /var/run/lighttpd
Restart=on-failure

[Install]
WantedBy=multi-user.target
1

The answer is

mkdir -p /var/run/lighttpd/
chown lighttpd /var/run/lighttpd

See http://www.kernelhardware.org/lighttpd-and-centos-5/

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
0
touch /tmp/php-fastcgi.socket

Just create the file with the above command.

EDIT: Either your using old log output or your conf is newer. Either way create /var/run/lighttpd/php-fastcgi.socket-0 or the above.

Ta

bsdjunkie
  • 121
  • 5
0

Verify that the /tmp/php-fastcgi.socket file exists, and if it doesn't, run

# touch /tmp/php-fastcgi.socket

then make sure the permissions and ownership/groups are set right with chmod/chown/chgrp. On my server that'd be:

# chmod 664 /tmp/php-fastcgi.socket
# chgrp websrv /tmp/php-fastcgi.socket
andrewd18
  • 874
  • 5
  • 8