From 789b9a56bc217a1234ef0d416a98a513f79e1463 Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Fri, 16 Jan 2015 10:44:29 +0000 Subject: [PATCH] Switch to more proper php-cgi configuration --- build/make/lighttpd-php.mk | 3 +-- build/scripts/lighttpd-php.sh | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/build/make/lighttpd-php.mk b/build/make/lighttpd-php.mk index 67ae5aa..1e598f5 100644 --- a/build/make/lighttpd-php.mk +++ b/build/make/lighttpd-php.mk @@ -1,4 +1,3 @@ lighttpd-php: php lighttpd $(call script,$@) - $(call boot,02,$@) - $(call runit,$@) \ No newline at end of file + $(call boot,02,$@) \ No newline at end of file diff --git a/build/scripts/lighttpd-php.sh b/build/scripts/lighttpd-php.sh index c1dd750..8051038 100644 --- a/build/scripts/lighttpd-php.sh +++ b/build/scripts/lighttpd-php.sh @@ -4,21 +4,15 @@ source /build/config set -x ## Environment -export_env PHP_CGI_PORT 5555 export_env PHP_CONFIG /host/etc/php.ini +export_env PHP_FCGI_CONFIG /etc/lighttpd/conf-enabled/15-fastcgi-php.conf +export_env PHP_FCGI_PORT 5555 +export_env PHP_FCGI_CHILDREN 16 +export_env PHP_FCGI_MAX_REQUESTS 2000 -## Enable configuration of PHP in Lighttpd +## Configuration ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/ -cat << EOF > /etc/lighttpd/conf-enabled/15-fastcgi-php.conf -fastcgi.server += ( - ".php" => ( - "localhost" =>( - "host" => "127.0.0.1", - "port" => $PHP_CGI_PORT - ) - ) -) -EOF - -## Workaround for PHP socket -# sed -i "s,\(\"socket\"\s*=>\s*\"\).*$,\1/tmp/php.socket\"\,," /etc/lighttpd/conf-enabled/15-fastcgi-php.conf \ No newline at end of file +cp /etc/lighttpd/conf-available/15-fastcgi-php.conf /etc/lighttpd/conf-enabled/ +sed -i "s,\(\"PHP_FCGI_CHILDREN\"\s*=>\s*\"\).*$,\1$PHP_FCGI_CHILDREN\"\,," $PHP_FCGI_CONFIG +sed -i "s,\(\"PHP_FCGI_MAX_REQUESTS\"\s*=>\s*\"\).*$,\1$PHP_FCGI_MAX_REQUESTS\"\,," $PHP_FCGI_CONFIG +sed -i "s,\(\"socket\"\),\"host\" => \"127.0.0.1\"\,\n\t\t\"port\" => $PHP_FCGI_PORT\,\n\t\t#\1," $PHP_FCGI_CONFIG \ No newline at end of file