Project

General

Profile

Lighttpd 1.5 + Fastcgi + PHP = Not working

Added by cmweb over 13 years ago

Hi Support,

I am not sure what I am doing wrong but I can't figure it out...

A) The Setup ========================
1) Lighttpd 1.5 (lighttpd-devel) r2533_0+bzip2 (installed) via macports)
2) Running Tiger 10.4.1 OS on Mac Mini PPC
3) installed PHP5.3 with FastCGI
4) Installed MySQL5
5) Added "PHPMyADMIN" in Root Directory and renamed folder as PHP
6) Installed Spawn-FCGI via Macports

B) The Issue ======================
1) When I Start lighttpd using sudo lighttpd -f /opt/local/etc/lighttpd-devel/lighttpd.conf -D
the homepage comes up fine.
2) when I navigate to the PHP folder I get the attached errors (see "lighttpd.error.log" file) and the page comes up blank.

Please see my lighttpd.conf file attached.

The "php-spawn-fcgi.sock" was created in directory "/var/run/lighttpd/" with server having "drwxr-xr-x" access to it.


Replies (3)

RE: Lighttpd 1.5 + Fastcgi + PHP = Not working - Added by MetaYii over 13 years ago

But it says there's no socket there. I haven't used a config like yours for fastcgi, so I can't tell you for sure, but, does it ask for a directory or for the full socket path? also, have you tried using TCP?

61 2010-09-13 12:59:02 (error) (mod_proxy_core.c:932) connect(unix:/var/run/lighttpd/php-spawn-fcgi.sock) failed: No such file or directory (2)
62 2010-09-13 12:59:02 (trace) (mod_proxy_core.c:1448) connecting to address unix:/var/run/lighttpd/php-spawn-fcgi.sock (0x6133e0) failed, disabling for 60 sec

RE: Lighttpd 1.5 + Fastcgi + PHP = Not working - Added by cmweb over 13 years ago

MetaYii,

Thanks for the reply. Unfortunately, I am very much an amateur with regard to webservers. I have just been following instructions on the web and trying to get it to work with PHP and Wordpress. If you have a different configuration which works I would love if you could share it with me.

I have been going round and round in circles :(.

I am not even sure what TCP is to use it ? BTW the webserver I am using is on my own computer...so I connect directly to it.

Thanks for any help.

Cmweb

RE: Lighttpd 1.5 + Fastcgi + PHP = Not working - Added by MetaYii over 13 years ago

Paths and file names depend on you own setup:

/etc/lighttpd/conf-available/10-fastcgi.conf

server.modules   += ( "mod_fastcgi" )

fastcgi.server = (   
   ".php" => (
               "php1" => ("host" => "127.0.0.1", "port" => 9999, "broken-scriptfilename" => "enable", "max-procs" => 1, "disable-time" => 2)
             )
)

fastcgi.debug = 1
fastcgi.map-extensions = (".php3" => ".php")

/etc/rc.d/rc.spawn-cgi

#!/bin/bash

SPAWNFCGI="/usr/bin/spawn-fcgi" 
FCGIPROGRAM="/usr/bin/php-cgi" 
FCGIIP="127.0.0.1" 
FCGIPORT="9999" 

PHP_FCGI_CHILDREN=5
PHP_FCGI_MAX_REQUESTS=300

FCGI_WEB_SERVER_ADDRS="127.0.0.1" 

ALLOWED_ENV="PATH USER" 

USERID=www-data
GROUPID=www-data

if test x$PHP_FCGI_CHILDREN = x; then
  PHP_FCGI_CHILDREN=5
fi

export PHP_FCGI_MAX_REQUESTS
export FCGI_WEB_SERVER_ADDRS

ALLOWED_ENV="$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS" 

E=

for i in $ALLOWED_ENV; do
  E="$E $i=$(eval echo "\$$i")" 
done

env - $E $SPAWNFCGI -a $FCGIIP -p $FCGIPORT -u $USERID -g $GROUPID -C $PHP_FCGI_CHILDREN -- $FCGIPROGRAM -c /etc/php/
    (1-3/3)