Project

General

Profile

Problem with PHP5 on Debian

Added by olesio almost 16 years ago

Hello.

I'm using lighttpd-1.4.22 on Debian VPS Server and it works fine, but I want add a php5 support - so I readed
text at http://redmine.lighttpd.net/wiki/lighttpd/TutorialLighttpdAndPHP and as root I made following things:
  1. apt-get install php5
  2. apt-get install php5-cgi

editd /etc/php5/cgi/php.ini file and add this line:
cgi.fix_pathinfo = 1

following command returns:
  1. php-cgi -v
    PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Apr 26 2009 22:11:16)
    Copyright (c) 1997-2008 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
Now I edited my httpd config file:
remove # from "mod_fastcgi" and "mod_cgi" in server.modules
alsoe added following line
[code]
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php5-cgi"
)
)
)
[/code]
But now when I try start a server again with command:
  1. /usr/local/sbin/lighttpd -f /root/server_www.conf
    no errors are shown but server do not start. When I add char # before "mod_fastcgi" again
    server starts but I can not show a file info.php file in my Opera browser, which contain:
    [code]
    phpinfo();
    ?>
    [/code]
    Without php I cannon open this file and get and error 403.
    So how to get php to work correctly? What I'm doing wrong?
    Sorry for long post and my bad english. Regards: olesio :)

EDIT: I solved this problem thanks to guys from #lighttpd at freenode.

I chceck the error.log and get:

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

so they recommend me create directory /var/run/lighttpd/ and spawn php5-cgi using command:
/usr/local/bin/spawn-fcgi -f /usr/bin/php5-cgi -s /var/run/lighttpd/php-fastcgi.socket -C 5
and now info.php file which contain
phpinfo();
?>
shows information correctly.


Replies (1)

RE: Problem with PHP5 on Debian - Added by Albright almost 16 years ago

You should probably remove the mod_cgi module from the configuration. You only need mod_fastcgi in this case.

    (1-1/1)