Project

General

Profile

Slackware 13 64-bit + php 5.3.0 + lighttpd 1.4.23 -> fastcgi problems

Added by lordbone over 14 years ago

Hello,

I had a fresh full install of slackware-13-64-bit, did a removepkg for httpd // php // mysql and recompiled my own mysql with php and lighttpd.

I started of compiling mysql with

./configure --prefix=/usr --localstatedir=/usr/mysql --enable-shared --with-pthread --with-mysqld-user=mysql

..continued with installing lighttpd using:


./configure --prefix=/usr --sysconfdir=/etc/httpd --enable-dependency-tracking --enable-shared --enable-lfs --enable-ipv6 --with-mysql --with-attr --with-openssl --with-pcre --with-zlib --with-bzip2 --with-memcache

and finally ended up with compiling php with:


./configure --enable-sockets --prefix=/usr --sysconfdir=/etc/php --with-config-file-path=/etc/php --enable-ipv6 --enable-safe-mode --with-openssl --with-mysql --with-snmp

The problem starts when i try to start my web-server, lighttpd fills my error.log with:


2009-10-13 13:55:54: (log.c.172) server started
2009-10-13 13:55:54: (mod_fastcgi.c.1087) the fastcgi-backend /usr/bin/php-cgi failed to start:
2009-10-13 13:55:54: (mod_fastcgi.c.1091) child exited with status 127 /usr/bin/php-cgi
2009-10-13 13:55:54: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2009-10-13 13:55:54: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2009-10-13 13:55:54: (server.c.928) Configuration of plugins failed. Going down.

As you can see below php and php-cgi are both functional:

??
  1. php -v
    PHP 5.3.0 (cli) (built: Oct 13 2009 13:53:35)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
  1. php-cgi -v
    PHP 5.3.0 (cgi-fcgi) (built: Oct 13 2009 13:53:28)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
    ??

...and in my lighttpd.conf i put in the following:

??
......
"mod_fastcgi",
......
fastcgi.server = ( ".php" =>
((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/etc/httpd/sockets/php.socket" + var.PID,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "80",
"PHP_FCGI_MAX_REQUESTS" => "1000"
)
))
)

??

On a "locate php-cgi", php-cgi is in the right path: /usr/bin/php-cgi

Turned on "fastcgi.debug = 1", but it still doesn't return much.


2009-10-13 14:31:07: (log.c.172) server started
2009-10-13 14:31:07: (mod_fastcgi.c.1365) --- fastcgi spawning local
proc: /usr/bin/php-cgi
port: 0
socket /etc/httpd/sockets/php.socket4679
min-procs: 4
max-procs: 4
2009-10-13 14:31:07: (mod_fastcgi.c.1390) --- fastcgi spawning
port: 0
socket /etc/httpd/sockets/php.socket4679
current: 0 / 4
2009-10-13 14:31:07: (mod_fastcgi.c.1087) the fastcgi-backend /usr/bin/php-cgi failed to start:
2009-10-13 14:31:07: (mod_fastcgi.c.1091) child exited with status 127 /usr/bin/php-cgi
2009-10-13 14:31:07: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2009-10-13 14:31:07: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2009-10-13 14:31:07: (server.c.928) Configuration of plugins failed. Going down.

Anyone got any idea what I`m doing wrong, and how do I get the blasted thing to work ?

P.S: I didn`t find anywhere what status 127 means, is it a missing lib, a file-not-found, a permissions error, anyone got a clue ?

Thanks in advance, sorry for all the quotes.

My lighttpd configuration file is located at http://paste.lighttpd.net/595 and it's missing an 'S' at the beggining (pasted wrong) .


Replies (1)

RE: Slackware 13 64-bit + php 5.3.0 + lighttpd 1.4.23 -> fastcgi problems - Added by lordbone over 14 years ago

Hello again, managed to fix it after a linux guru helped me out.

Lighttpd ran as user lighttpd group lighttpd, but as user lighttpd i couldn't run php-cgi.

After his directions, I did a
su lighttpd php-cgi -v

and finally saw that it had a problem with a libmysqlxxx...so extension.

As root user I had no problem running php-cgi, but as lighttpd user it had a more or less permissions problem.

The thing is that my mysql libs are in /usr/mysql/lib rather than /usr/lib/mysql.

Had some problems with that, so I created a symlink for /usr/lib/mysql -> /usr/mysql/lib but it seemed that lighttpd didn't like that.

As a fix, I did it the old way, did a
rm -rf /usr/lib/mysql; mkdir -p /usr/lib/mysql; cp -R /usr/mysql/lib/ /usr/lib/mysql

and it worked :).

Hope this helps if anyone will ever encounter the same problem.

Leave a private message it this helps.

Cheers.

    (1-1/1)