用户工具

站点工具


howto:n:php_fastcgi_lighttpd

lighttpd安装配置支持php

安装lighttpd

记得在SPAWNFCGI前打勾

[X] SPAWNFCGI  Depend on spawn-fcgi utility
#cd /usr/ports/www/lighttpd
#make config
#make install clean

安装php

模块自己看自己需要

#cd /usr/ports/lang/php5/ && make install clean
#cd /usr/ports/lang/php5-extensions/ && make install clean

配置lighttpd

编辑/usr/local/etc/lighttpd/lighttpd.conf,添加以下内容:

server.modules += ( "mod_fastcgi" )
fastcgi.server = ( ".php" =>
  (( "socket" => "/tmp/php-fastcgi.socket",
    "bin-path" => "/usr/local/bin/php-cgi",
     "min-procs" => 1,
     "max-procs" => 1,
     "max-load-per-proc" => 4,
     "bin-environment" => (
     "PHP_FCGI_CHILDREN" => "2",
    #"PHP_FCGI_CHILDREN" => "64",//这里进程数自己看着办
        "PHP_FCGI_MAX_REQUESTS" => "10000" ),
      "bin-copy-environment" => (
        "PATH", "SHELL", "USER" ),
      "broken-scriptfilename" => "enable",
     "idle-timeout" => 20
  ))
)

设置服务

启动lighttpd

#echo 'lighttpd_enable="YES"' >> /etc/rc.conf
#/usr/local/etc/rc.d/lighttpd start

网站跟目录是修改这行

server.document-root = "/usr/local/www/data/"
/data/vhosts/wiki-data/pages/howto/n/php_fastcgi_lighttpd.txt · 最后更改: 2011/02/24 16:42 由 bestwc