LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-13-2009, 06:34 AM   #1
lordbone
LQ Newbie
 
Registered: May 2009
Posts: 13

Rep: Reputation: 0
Slackware 13 64-bit + php 5.3.0 + lighttpd 1.4.23 -> fastcgi problems


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
Quote:
./configure --prefix=/usr --localstatedir=/usr/mysql --enable-shared --with-pthread --with-mysqld-user=mysql
..continued with installing lighttpd using:

Quote:
./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:

Quote:
./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:

Quote:
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:

Quote:
# 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

# 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:

Quote:
......
"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.

Quote:
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.
 
Old 10-13-2009, 06:58 AM   #2
lordbone
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
As a P.S:

I tried compiling php-5.2.9 and 5.2.11 and I get the same error with each and every one.
 
Old 10-14-2009, 11:00 AM   #3
lordbone
LQ Newbie
 
Registered: May 2009
Posts: 13

Original Poster
Rep: Reputation: 0
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
Quote:
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
Quote:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lighttpd + Fastcgi + ruby How? chutsu Linux - Server 0 08-17-2009 05:12 PM
Error php fastCGI vuit Linux - Server 1 02-28-2009 10:48 PM
PHP FastCGI security robertjinx Linux - Security 1 08-22-2008 02:56 AM
Setup Apache2 with PHP FastCGI jlukensow Linux - Server 1 01-29-2008 04:30 PM
PHP FastCGI/Apache Module Question.... Voltar Linux - Software 4 06-22-2006 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration