Switch to more proper php-cgi configuration
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
lighttpd-php: php lighttpd
|
lighttpd-php: php lighttpd
|
||||||
$(call script,$@)
|
$(call script,$@)
|
||||||
$(call boot,02,$@)
|
$(call boot,02,$@)
|
||||||
$(call runit,$@)
|
|
||||||
@@ -4,21 +4,15 @@ source /build/config
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
export_env PHP_CGI_PORT 5555
|
|
||||||
export_env PHP_CONFIG /host/etc/php.ini
|
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/
|
ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/
|
||||||
cat << EOF > /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
|
cp /etc/lighttpd/conf-available/15-fastcgi-php.conf /etc/lighttpd/conf-enabled/
|
||||||
fastcgi.server += (
|
sed -i "s,\(\"PHP_FCGI_CHILDREN\"\s*=>\s*\"\).*$,\1$PHP_FCGI_CHILDREN\"\,," $PHP_FCGI_CONFIG
|
||||||
".php" => (
|
sed -i "s,\(\"PHP_FCGI_MAX_REQUESTS\"\s*=>\s*\"\).*$,\1$PHP_FCGI_MAX_REQUESTS\"\,," $PHP_FCGI_CONFIG
|
||||||
"localhost" =>(
|
sed -i "s,\(\"socket\"\),\"host\" => \"127.0.0.1\"\,\n\t\t\"port\" => $PHP_FCGI_PORT\,\n\t\t#\1," $PHP_FCGI_CONFIG
|
||||||
"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
|
|
||||||
Reference in New Issue
Block a user