Daily Archive for Septiembre 21st, 2007

PHP with lighttpd 1.5.0

  • english
  • spanish

PHP integration and configuration in lighttpd 1.5.0 has changed: mod_fastcgi isn’t used any more, you need mod_proxy_backend_fastcgi instead; and lighty won’t launch the PHP processes, you’ll have to start them using the spawn-fcgi program.

In order to setup mod_proxycore for use with PHP, this is the bare minimum configuration (put it in lighttpd.conf, or conf-enabled/php.conf):

[code lang="bash"]

server.modules += ( "mod_proxy_core", "mod_proxy_backend_fastcgi" )

$PHYSICAL["existing-path"] =~ ".php$" {
proxy-core.allow-x-sendfile = "enable"
proxy-core.protocol = "fastcgi"
proxy-core.backends = ( "unix:/tmp/php-fastcgi.sock" )
proxy-core.max-pool-size = 16
}
[/code]
And for the PHP fast-cgi processes, just run or prepare an init.d script that runs the following command:
[code lang="bash"]

/usr/bin/spawn-fcgi -s /tmp/php-fastcgi.sock -f /usr/bin/php-cgi -u www-data -g www-data -C 5 -P /var/run/spawn-fcgi.pid

[/code]

  • Twitter
  • Facebook
  • Meneame
  • email
  • Print
  • PDF
  • RSS



Creative Commons Attribution-NonCommercial 2.5 Spain
This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 Spain.