All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
@ 2015-05-01 18:12 Floris Bos
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Floris Bos @ 2015-05-01 18:12 UTC (permalink / raw)
  To: buildroot

Prevent a warning being logged each time a PHP date/time method is
used by setting UTC as (default) timezone in php.ini

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
---
 package/php/php.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/php/php.mk b/package/php/php.mk
index 3b9a117..7bd3f63 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -288,6 +288,7 @@ define PHP_INSTALL_FIXUP
 	rm -f $(TARGET_DIR)/usr/bin/phpize
 	$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
 		$(TARGET_DIR)/etc/php.ini
+	$(SED) 's/;date.timezone =/date.timezone = UTC/' $(TARGET_DIR)/etc/php.ini
 endef
 
 PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 18:12 [Buildroot] [PATCH] php.ini: set date.timezone to UTC Floris Bos
@ 2015-05-01 18:12 ` Floris Bos
  2015-05-01 22:34   ` Arnout Vandecappelle
                     ` (2 more replies)
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf Floris Bos
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 18+ messages in thread
From: Floris Bos @ 2015-05-01 18:12 UTC (permalink / raw)
  To: buildroot

Install the startup script if using the FastCGI Process Manager.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

---
v2: add systemd support
---
 package/php/0006-fix-php-fpm.service.in.patch | 35 +++++++++++++++++++++++++++
 package/php/php.mk                            | 15 ++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 package/php/0006-fix-php-fpm.service.in.patch

diff --git a/package/php/0006-fix-php-fpm.service.in.patch b/package/php/0006-fix-php-fpm.service.in.patch
new file mode 100644
index 0000000..a182a25
--- /dev/null
+++ b/package/php/0006-fix-php-fpm.service.in.patch
@@ -0,0 +1,35 @@
+From bb19125781c0794da9a63fee62e263ff4efff661 Mon Sep 17 00:00:00 2001
+From: Floris Bos <bos@je-eigen-domein.nl>
+Date: Fri, 1 May 2015 15:28:55 +0200
+Subject: [PATCH] Fix php-fpm.service.in
+
+- Expand file paths.
+- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
+
+Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
+---
+ sapi/fpm/php-fpm.service.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
+index a2df30e..c135f04 100644
+--- a/sapi/fpm/php-fpm.service.in
++++ b/sapi/fpm/php-fpm.service.in
+@@ -1,11 +1,11 @@
+ [Unit]
+ Description=The PHP FastCGI Process Manager
+-After=syslog.target network.target
++After=network.target
+ 
+ [Service]
+ Type=@php_fpm_systemd@
+-PIDFile=@localstatedir@/run/php-fpm.pid
+-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
++PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
++ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
+ ExecReload=/bin/kill -USR2 $MAINPID
+ 
+ [Install]
+-- 
+2.1.4
+
diff --git a/package/php/php.mk b/package/php/php.mk
index e4331f2..4c65c35 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -251,6 +251,21 @@ PHP_CONF_OPTS += \
 PHP_DEPENDENCIES += jpeg libpng freetype
 endif
 
+ifeq ($(BR2_PACKAGE_PHP_FPM),y)
+define PHP_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \
+		$(TARGET_DIR)/etc/init.d/S49php-fpm
+endef
+
+define PHP_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 $(@D)/sapi/fpm/php-fpm.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/php-fpm.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
+endef
+endif
+
 define PHP_EXTENSIONS_FIXUP
 	$(SED) "/prefix/ s:/usr:$(STAGING_DIR)/usr:" \
 		$(STAGING_DIR)/usr/bin/phpize
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf
  2015-05-01 18:12 [Buildroot] [PATCH] php.ini: set date.timezone to UTC Floris Bos
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
@ 2015-05-01 18:12 ` Floris Bos
  2015-05-01 22:36   ` Arnout Vandecappelle
  2015-05-02  7:45   ` Thomas Petazzoni
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration Floris Bos
  2015-05-01 22:23 ` [Buildroot] [PATCH] php.ini: set date.timezone to UTC Arnout Vandecappelle
  3 siblings, 2 replies; 18+ messages in thread
From: Floris Bos @ 2015-05-01 18:12 UTC (permalink / raw)
  To: buildroot

Install a custom php-fpm.conf instead of the stock one.

- Listening on /var/run/php-fpm.sock instead of TCP port so we can
  restrict access to webserver user www-data.
- Using ondemand pm, so PHP children are only started after a PHP
  request, instead of kept resident all the time.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

---
v2: limit children to 5 by default
---
 package/php/php-fpm.conf | 14 ++++++++++++++
 package/php/php.mk       |  8 ++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 package/php/php-fpm.conf

diff --git a/package/php/php-fpm.conf b/package/php/php-fpm.conf
new file mode 100644
index 0000000..b75a58f
--- /dev/null
+++ b/package/php/php-fpm.conf
@@ -0,0 +1,14 @@
+[www]
+# Only start children when there are requests to be processed
+pm = ondemand
+# Terminate them again after there haven't been any for 2 minutes
+pm.process_idle_timeout = 120s
+# Maximum number of children processing PHP requests concurrently
+pm.max_children = 5
+
+listen = /var/run/php-fpm.sock
+listen.owner = www-data
+listen.group = www-data
+user = www-data
+group = www-data
+
diff --git a/package/php/php.mk b/package/php/php.mk
index 4c65c35..3b9a117 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -264,6 +264,14 @@ define PHP_INSTALL_INIT_SYSTEMD
 	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
 		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
 endef
+
+define PHP_INSTALL_FPM_CONF
+	$(INSTALL) -D -m 0644 package/php/php-fpm.conf \
+		$(TARGET_DIR)/etc/php-fpm.conf
+	rm -f $(TARGET_DIR)/etc/php-fpm.conf.default
+endef
+
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF
 endif
 
 define PHP_EXTENSIONS_FIXUP
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration
  2015-05-01 18:12 [Buildroot] [PATCH] php.ini: set date.timezone to UTC Floris Bos
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf Floris Bos
@ 2015-05-01 18:12 ` Floris Bos
  2015-05-02 21:17   ` Arnout Vandecappelle
  2015-05-01 22:23 ` [Buildroot] [PATCH] php.ini: set date.timezone to UTC Arnout Vandecappelle
  3 siblings, 1 reply; 18+ messages in thread
From: Floris Bos @ 2015-05-01 18:12 UTC (permalink / raw)
  To: buildroot

If both lighttpd and php-fpm are selected, offer to
enable PHP in the lighttpd configuration.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
---
 package/lighttpd/Config.in    | 20 ++++++++++++++++++++
 package/lighttpd/fastcgi.conf |  2 ++
 package/lighttpd/lighttpd.mk  | 11 +++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 package/lighttpd/fastcgi.conf

diff --git a/package/lighttpd/Config.in b/package/lighttpd/Config.in
index 2c101e7..e984ef8 100644
--- a/package/lighttpd/Config.in
+++ b/package/lighttpd/Config.in
@@ -56,4 +56,24 @@ config BR2_PACKAGE_LIGHTTPD_LUA
 	help
 	  Enable Lua support. Needed to support mod_magnet
 
+config BR2_PACKAGE_LIGHTTPD_PHP_FPM
+	bool "enable php in configuration"
+	depends on BR2_PACKAGE_PHP
+	depends on BR2_PACKAGE_PHP_FPM
+	default "y"
+	help
+	  Configure lighttpd to handle PHP requests through php-fpm.
+
+	  Also enables allow-x-send-file, allowing you to offload static file sending
+	  to lighttpd with PHP code like:
+
+	  header("X-Send-File: /path/to/file");
+
+	  This is a necessity for letting the user download larger files, as
+	  lighttpd buffers all PHP script output infinitely to memory, and
+	  may run out if you use the normal readfile() method to output files.
+
+comment "php support depends on php with FPM sapi"
+	depends on !BR2_PACKAGE_PHP || !BR2_PACKAGE_PHP_FPM
+
 endif
diff --git a/package/lighttpd/fastcgi.conf b/package/lighttpd/fastcgi.conf
new file mode 100644
index 0000000..46c5f9a
--- /dev/null
+++ b/package/lighttpd/fastcgi.conf
@@ -0,0 +1,2 @@
+server.modules += ( "mod_fastcgi" )
+fastcgi.server  = ( ".php" => (( "socket" => "/var/run/php-fpm.sock", "allow-x-send-file" => "enable" )) )
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index 626cd69..16ca88b 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -77,6 +77,17 @@ endef
 
 LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
 
+ifeq ($(BR2_PACKAGE_LIGHTTPD_PHP_FPM),y)
+define LIGHTTPD_INSTALL_FASTCGI_CONFIG
+	$(INSTALL) -D -m 0644 package/lighttpd/fastcgi.conf \
+		$(TARGET_DIR)/etc/lighttpd/conf.d/fastcgi.conf
+	$(SED) '/#include \"conf.d\/fastcgi.conf\"/s/^#//' \
+		$(TARGET_DIR)/etc/lighttpd/modules.conf
+endef
+
+LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_FASTCGI_CONFIG
+endif
+
 define LIGHTTPD_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/lighttpd/S50lighttpd \
 		$(TARGET_DIR)/etc/init.d/S50lighttpd
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-01 18:12 [Buildroot] [PATCH] php.ini: set date.timezone to UTC Floris Bos
                   ` (2 preceding siblings ...)
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration Floris Bos
@ 2015-05-01 22:23 ` Arnout Vandecappelle
  2015-05-01 23:08   ` Floris Bos
  3 siblings, 1 reply; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-01 22:23 UTC (permalink / raw)
  To: buildroot

On 01/05/15 20:12, Floris Bos wrote:
> Prevent a warning being logged each time a PHP date/time method is
> used by setting UTC as (default) timezone in php.ini
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> ---
>  package/php/php.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/php/php.mk b/package/php/php.mk
> index 3b9a117..7bd3f63 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -288,6 +288,7 @@ define PHP_INSTALL_FIXUP
>  	rm -f $(TARGET_DIR)/usr/bin/phpize
>  	$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
>  		$(TARGET_DIR)/etc/php.ini
> +	$(SED) 's/;date.timezone =/date.timezone = UTC/' $(TARGET_DIR)/etc/php.ini

 Would it be possible to use BR2_TARGET_LOCALTIME (if set) instead? Something like:

ifeq ($(BR2_TARGET_LOCALTIME),)
PHP_LOCALTIME = UTC
else
PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
endif

	$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
		$(TARGET_DIR)/etc/php.ini

 That is, assuming that php can deal with complex timezones like Europe/Brussels.

 Regards,
 Arnout

>  endef
>  
>  PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
@ 2015-05-01 22:34   ` Arnout Vandecappelle
  2015-05-01 22:58     ` Floris Bos
  2015-05-01 23:07   ` Arnout Vandecappelle
  2015-05-02  7:44   ` Thomas Petazzoni
  2 siblings, 1 reply; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-01 22:34 UTC (permalink / raw)
  To: buildroot

On 01/05/15 20:12, Floris Bos wrote:
> Install the startup script if using the FastCGI Process Manager.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> 
> ---
> v2: add systemd support
> ---
>  package/php/0006-fix-php-fpm.service.in.patch | 35 +++++++++++++++++++++++++++
>  package/php/php.mk                            | 15 ++++++++++++
>  2 files changed, 50 insertions(+)
>  create mode 100644 package/php/0006-fix-php-fpm.service.in.patch
> 
> diff --git a/package/php/0006-fix-php-fpm.service.in.patch b/package/php/0006-fix-php-fpm.service.in.patch
> new file mode 100644
> index 0000000..a182a25
> --- /dev/null
> +++ b/package/php/0006-fix-php-fpm.service.in.patch
> @@ -0,0 +1,35 @@
> +From bb19125781c0794da9a63fee62e263ff4efff661 Mon Sep 17 00:00:00 2001
> +From: Floris Bos <bos@je-eigen-domein.nl>
> +Date: Fri, 1 May 2015 15:28:55 +0200
> +Subject: [PATCH] Fix php-fpm.service.in
> +
> +- Expand file paths.
> +- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.

 Well, we do have a unit file for rsyslogd...

 Will you submit this patch upstream?

> +
> +Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> +---
> + sapi/fpm/php-fpm.service.in | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
> +index a2df30e..c135f04 100644
> +--- a/sapi/fpm/php-fpm.service.in
> ++++ b/sapi/fpm/php-fpm.service.in
> +@@ -1,11 +1,11 @@
> + [Unit]
> + Description=The PHP FastCGI Process Manager
> +-After=syslog.target network.target
> ++After=network.target

 I actually don't see why this is needed. If no syslog.target is defined, then
it will be ignored (at least that's what I understand from the systemd
documentation [1]).


 Regards,
 Arnout

> + 
> + [Service]
> + Type=@php_fpm_systemd@
> +-PIDFile=@localstatedir@/run/php-fpm.pid
> +-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
> ++PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
> ++ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
> + ExecReload=/bin/kill -USR2 $MAINPID
> + 
> + [Install]
> +-- 
> +2.1.4

[snip]

[1] http://www.freedesktop.org/software/systemd/man/systemd.unit.html
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf Floris Bos
@ 2015-05-01 22:36   ` Arnout Vandecappelle
  2015-05-02  7:45   ` Thomas Petazzoni
  1 sibling, 0 replies; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-01 22:36 UTC (permalink / raw)
  To: buildroot

On 01/05/15 20:12, Floris Bos wrote:
> Install a custom php-fpm.conf instead of the stock one.
> 
> - Listening on /var/run/php-fpm.sock instead of TCP port so we can
>   restrict access to webserver user www-data.
> - Using ondemand pm, so PHP children are only started after a PHP
>   request, instead of kept resident all the time.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> 
> ---
> v2: limit children to 5 by default

 And split it into two patches :-)

 Regards,
 Arnout

> ---
>  package/php/php-fpm.conf | 14 ++++++++++++++
>  package/php/php.mk       |  8 ++++++++
>  2 files changed, 22 insertions(+)
>  create mode 100644 package/php/php-fpm.conf
> 
> diff --git a/package/php/php-fpm.conf b/package/php/php-fpm.conf
> new file mode 100644
> index 0000000..b75a58f
> --- /dev/null
> +++ b/package/php/php-fpm.conf
> @@ -0,0 +1,14 @@
> +[www]
> +# Only start children when there are requests to be processed
> +pm = ondemand
> +# Terminate them again after there haven't been any for 2 minutes
> +pm.process_idle_timeout = 120s
> +# Maximum number of children processing PHP requests concurrently
> +pm.max_children = 5
> +
> +listen = /var/run/php-fpm.sock
> +listen.owner = www-data
> +listen.group = www-data
> +user = www-data
> +group = www-data
> +
> diff --git a/package/php/php.mk b/package/php/php.mk
> index 4c65c35..3b9a117 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -264,6 +264,14 @@ define PHP_INSTALL_INIT_SYSTEMD
>  	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
>  		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
>  endef
> +
> +define PHP_INSTALL_FPM_CONF
> +	$(INSTALL) -D -m 0644 package/php/php-fpm.conf \
> +		$(TARGET_DIR)/etc/php-fpm.conf
> +	rm -f $(TARGET_DIR)/etc/php-fpm.conf.default
> +endef
> +
> +PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FPM_CONF
>  endif
>  
>  define PHP_EXTENSIONS_FIXUP
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 22:34   ` Arnout Vandecappelle
@ 2015-05-01 22:58     ` Floris Bos
  2015-05-01 23:06       ` Arnout Vandecappelle
  0 siblings, 1 reply; 18+ messages in thread
From: Floris Bos @ 2015-05-01 22:58 UTC (permalink / raw)
  To: buildroot

Hi,

On 05/02/2015 12:34 AM, Arnout Vandecappelle wrote:
> +- Expand file paths.
> +- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
>   Well, we do have a unit file for rsyslogd...

Other distros consider it obsolete, and told their maintainers to remove 
syslog.target last year.

http://lists.opensuse.org/archive/opensuse-packaging/2013-05/msg00102.html
https://lintian.debian.org/tags/systemd-service-file-refers-to-obsolete-target.html

>   Will you submit this patch upstream?

Did submit a simple pull request to php-src github earlier today.
But do not plan to chase it.


Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 22:58     ` Floris Bos
@ 2015-05-01 23:06       ` Arnout Vandecappelle
  0 siblings, 0 replies; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-01 23:06 UTC (permalink / raw)
  To: buildroot

On 02/05/15 00:58, Floris Bos wrote:
> Hi,
> 
> On 05/02/2015 12:34 AM, Arnout Vandecappelle wrote:
>> +- Expand file paths.
>> +- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
>>   Well, we do have a unit file for rsyslogd...
> 
> Other distros consider it obsolete, and told their maintainers to remove
> syslog.target last year.
> 
> http://lists.opensuse.org/archive/opensuse-packaging/2013-05/msg00102.html
> https://lintian.debian.org/tags/systemd-service-file-refers-to-obsolete-target.html

 Ah OK I get it now.


 Thanks,
 Arnout

> 
>>   Will you submit this patch upstream?
> 
> Did submit a simple pull request to php-src github earlier today.
> But do not plan to chase it.
> 
> 
> Yours sincerely,
> 
> Floris Bos
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
  2015-05-01 22:34   ` Arnout Vandecappelle
@ 2015-05-01 23:07   ` Arnout Vandecappelle
  2015-05-02  7:44   ` Thomas Petazzoni
  2 siblings, 0 replies; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-01 23:07 UTC (permalink / raw)
  To: buildroot

On 01/05/15 20:12, Floris Bos wrote:
> Install the startup script if using the FastCGI Process Manager.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 (after Floris' further explanation).

 Regards,
 Arnout

> 
> ---
> v2: add systemd support
> ---
>  package/php/0006-fix-php-fpm.service.in.patch | 35 +++++++++++++++++++++++++++
>  package/php/php.mk                            | 15 ++++++++++++
>  2 files changed, 50 insertions(+)
>  create mode 100644 package/php/0006-fix-php-fpm.service.in.patch
> 
> diff --git a/package/php/0006-fix-php-fpm.service.in.patch b/package/php/0006-fix-php-fpm.service.in.patch
> new file mode 100644
> index 0000000..a182a25
> --- /dev/null
> +++ b/package/php/0006-fix-php-fpm.service.in.patch
> @@ -0,0 +1,35 @@
> +From bb19125781c0794da9a63fee62e263ff4efff661 Mon Sep 17 00:00:00 2001
> +From: Floris Bos <bos@je-eigen-domein.nl>
> +Date: Fri, 1 May 2015 15:28:55 +0200
> +Subject: [PATCH] Fix php-fpm.service.in
> +
> +- Expand file paths.
> +- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
> +
> +Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> +---
> + sapi/fpm/php-fpm.service.in | 6 +++---
> + 1 file changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
> +index a2df30e..c135f04 100644
> +--- a/sapi/fpm/php-fpm.service.in
> ++++ b/sapi/fpm/php-fpm.service.in
> +@@ -1,11 +1,11 @@
> + [Unit]
> + Description=The PHP FastCGI Process Manager
> +-After=syslog.target network.target
> ++After=network.target
> + 
> + [Service]
> + Type=@php_fpm_systemd@
> +-PIDFile=@localstatedir@/run/php-fpm.pid
> +-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
> ++PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
> ++ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
> + ExecReload=/bin/kill -USR2 $MAINPID
> + 
> + [Install]
> +-- 
> +2.1.4
> +
> diff --git a/package/php/php.mk b/package/php/php.mk
> index e4331f2..4c65c35 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -251,6 +251,21 @@ PHP_CONF_OPTS += \
>  PHP_DEPENDENCIES += jpeg libpng freetype
>  endif
>  
> +ifeq ($(BR2_PACKAGE_PHP_FPM),y)
> +define PHP_INSTALL_INIT_SYSV
> +	$(INSTALL) -D -m 0755 $(@D)/sapi/fpm/init.d.php-fpm \
> +		$(TARGET_DIR)/etc/init.d/S49php-fpm
> +endef
> +
> +define PHP_INSTALL_INIT_SYSTEMD
> +	$(INSTALL) -D -m 0644 $(@D)/sapi/fpm/php-fpm.service \
> +		$(TARGET_DIR)/usr/lib/systemd/system/php-fpm.service
> +	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +	ln -fs ../../../../usr/lib/systemd/system/php-fpm.service \
> +		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/php-fpm.service
> +endef
> +endif
> +
>  define PHP_EXTENSIONS_FIXUP
>  	$(SED) "/prefix/ s:/usr:$(STAGING_DIR)/usr:" \
>  		$(STAGING_DIR)/usr/bin/phpize
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-01 22:23 ` [Buildroot] [PATCH] php.ini: set date.timezone to UTC Arnout Vandecappelle
@ 2015-05-01 23:08   ` Floris Bos
  2015-05-02  7:49     ` Arnout Vandecappelle
  0 siblings, 1 reply; 18+ messages in thread
From: Floris Bos @ 2015-05-01 23:08 UTC (permalink / raw)
  To: buildroot

On 05/02/2015 12:23 AM, Arnout Vandecappelle wrote:
> On 01/05/15 20:12, Floris Bos wrote:
>> Prevent a warning being logged each time a PHP date/time method is
>> used by setting UTC as (default) timezone in php.ini
>>
>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>> ---
>>   package/php/php.mk | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/package/php/php.mk b/package/php/php.mk
>> index 3b9a117..7bd3f63 100644
>> --- a/package/php/php.mk
>> +++ b/package/php/php.mk
>> @@ -288,6 +288,7 @@ define PHP_INSTALL_FIXUP
>>   	rm -f $(TARGET_DIR)/usr/bin/phpize
>>   	$(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
>>   		$(TARGET_DIR)/etc/php.ini
>> +	$(SED) 's/;date.timezone =/date.timezone = UTC/' $(TARGET_DIR)/etc/php.ini
>   Would it be possible to use BR2_TARGET_LOCALTIME (if set) instead? Something like:
>
> ifeq ($(BR2_TARGET_LOCALTIME),)
> PHP_LOCALTIME = UTC
> else
> PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
> endif
>
> 	$(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
> 		$(TARGET_DIR)/etc/php.ini
>
>   That is, assuming that php can deal with complex timezones like Europe/Brussels.

PHP used to use the system's time zone name automatically in older PHP 
versions.
But nowadays fills your log with warnings that is not reliable:

==
Warning: strtotime(): It is not safe to rely on the system's timezone 
settings. You are *required* to use the date.timezone setting or the 
date_default_timezone_set() function. In case you used any of those 
methods and you are still getting this warning, you most likely 
misspelled the timezone identifier. We selected the timezone 'UTC' for 
now, but please set date.timezone to select your timezone.
==

It certainly does work for common names like Europe/Brussels, but not 
sure if that goes for every zone name.


Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
  2015-05-01 22:34   ` Arnout Vandecappelle
  2015-05-01 23:07   ` Arnout Vandecappelle
@ 2015-05-02  7:44   ` Thomas Petazzoni
  2 siblings, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2015-05-02  7:44 UTC (permalink / raw)
  To: buildroot

Dear Floris Bos,

On Fri,  1 May 2015 20:12:33 +0200, Floris Bos wrote:
> Install the startup script if using the FastCGI Process Manager.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> 
> ---
> v2: add systemd support
> ---
>  package/php/0006-fix-php-fpm.service.in.patch | 35 +++++++++++++++++++++++++++
>  package/php/php.mk                            | 15 ++++++++++++
>  2 files changed, 50 insertions(+)
>  create mode 100644 package/php/0006-fix-php-fpm.service.in.patch

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf Floris Bos
  2015-05-01 22:36   ` Arnout Vandecappelle
@ 2015-05-02  7:45   ` Thomas Petazzoni
  1 sibling, 0 replies; 18+ messages in thread
From: Thomas Petazzoni @ 2015-05-02  7:45 UTC (permalink / raw)
  To: buildroot

Dear Floris Bos,

On Fri,  1 May 2015 20:12:34 +0200, Floris Bos wrote:
> Install a custom php-fpm.conf instead of the stock one.
> 
> - Listening on /var/run/php-fpm.sock instead of TCP port so we can
>   restrict access to webserver user www-data.
> - Using ondemand pm, so PHP children are only started after a PHP
>   request, instead of kept resident all the time.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> 
> ---
> v2: limit children to 5 by default
> ---
>  package/php/php-fpm.conf | 14 ++++++++++++++
>  package/php/php.mk       |  8 ++++++++
>  2 files changed, 22 insertions(+)
>  create mode 100644 package/php/php-fpm.conf

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-01 23:08   ` Floris Bos
@ 2015-05-02  7:49     ` Arnout Vandecappelle
  2015-05-02 12:15       ` Floris Bos
  2015-05-02 15:09       ` Floris Bos
  0 siblings, 2 replies; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-02  7:49 UTC (permalink / raw)
  To: buildroot

On 02/05/15 01:08, Floris Bos wrote:
> On 05/02/2015 12:23 AM, Arnout Vandecappelle wrote:
>> On 01/05/15 20:12, Floris Bos wrote:
>>> Prevent a warning being logged each time a PHP date/time method is
>>> used by setting UTC as (default) timezone in php.ini
>>>
>>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>>> ---
>>>   package/php/php.mk | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/package/php/php.mk b/package/php/php.mk
>>> index 3b9a117..7bd3f63 100644
>>> --- a/package/php/php.mk
>>> +++ b/package/php/php.mk
>>> @@ -288,6 +288,7 @@ define PHP_INSTALL_FIXUP
>>>       rm -f $(TARGET_DIR)/usr/bin/phpize
>>>       $(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
>>>           $(TARGET_DIR)/etc/php.ini
>>> +    $(SED) 's/;date.timezone =/date.timezone = UTC/' $(TARGET_DIR)/etc/php.ini
>>   Would it be possible to use BR2_TARGET_LOCALTIME (if set) instead? Something
>> like:
>>
>> ifeq ($(BR2_TARGET_LOCALTIME),)
>> PHP_LOCALTIME = UTC
>> else
>> PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
>> endif
>>
>>     $(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
>>         $(TARGET_DIR)/etc/php.ini
>>
>>   That is, assuming that php can deal with complex timezones like
>> Europe/Brussels.
> 
> PHP used to use the system's time zone name automatically in older PHP versions.
> But nowadays fills your log with warnings that is not reliable:
> 
> ==
> Warning: strtotime(): It is not safe to rely on the system's timezone settings.

 Any idea _why_ it is not safe? I've tried to google it but didn't come up with
a reason, just a lot of fixes.

> You are *required* to use the date.timezone setting or the
> date_default_timezone_set() function. In case you used any of those methods and
> you are still getting this warning, you most likely misspelled the timezone
> identifier. We selected the timezone 'UTC' for now, but please set date.timezone
> to select your timezone.
> ==
> 
> It certainly does work for common names like Europe/Brussels, but not sure if
> that goes for every zone name.

 Hm, php (like so often) has its own re-implementation of the timezone
database... . It's based on the same Olson database so it's probably OK for
valid timezones, but tzdata has additional posix/ and right/ variants and it
also has the old SystemV/ timezones...

 Well, people who use one of these weird timezones will see the php error so
they can solve it I guess.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-02  7:49     ` Arnout Vandecappelle
@ 2015-05-02 12:15       ` Floris Bos
  2015-05-02 12:18         ` Gustavo Zacarias
  2015-05-02 15:09       ` Floris Bos
  1 sibling, 1 reply; 18+ messages in thread
From: Floris Bos @ 2015-05-02 12:15 UTC (permalink / raw)
  To: buildroot

On 05/02/2015 09:49 AM, Arnout Vandecappelle wrote:
> On 02/05/15 01:08, Floris Bos wrote:
>> On 05/02/2015 12:23 AM, Arnout Vandecappelle wrote:
>> == Warning: strtotime(): It is not safe to rely on the system's 
>> timezone settings. 
>   Any idea _why_ it is not safe? I've tried to google it but didn't come up with
> a reason, just a lot of fixes.

No idea.

>> You are *required* to use the date.timezone setting or the
>> date_default_timezone_set() function. In case you used any of those methods and
>> you are still getting this warning, you most likely misspelled the timezone
>> identifier. We selected the timezone 'UTC' for now, but please set date.timezone
>> to select your timezone.
>> ==
>>
>> It certainly does work for common names like Europe/Brussels, but not sure if
>> that goes for every zone name.
>   Hm, php (like so often) has its own re-implementation of the timezone
> database... . It's based on the same Olson database so it's probably OK for
> valid timezones, but tzdata has additional posix/ and right/ variants and it
> also has the old SystemV/ timezones...
>
>   Well, people who use one of these weird timezones will see the php error so
> they can solve it I guess.

I do know Debian has a patch to let PHP use the system's timezone 
database instead of the internal one.
We could borrow that one, but then we would be deviating from upstream 
(which did not want the patch, and prefers to stick with their internal db).


Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-02 12:15       ` Floris Bos
@ 2015-05-02 12:18         ` Gustavo Zacarias
  0 siblings, 0 replies; 18+ messages in thread
From: Gustavo Zacarias @ 2015-05-02 12:18 UTC (permalink / raw)
  To: buildroot

On 05/02/2015 09:15 AM, Floris Bos wrote:

> I do know Debian has a patch to let PHP use the system's timezone
> database instead of the internal one.
> We could borrow that one, but then we would be deviating from upstream
> (which did not want the patch, and prefers to stick with their internal
> db).

As far as i remember it's a chicken-and-egg problem.
PHP is used in many old distros/systems that don't have modern tzdata
and that was a problem, so they bundled it (also cross-operating system
consistent behaviour).
But then the bundled one might be out of date as well, and takes up space :)
IMHO it should be a build-time php option.
Regards.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH] php.ini: set date.timezone to UTC
  2015-05-02  7:49     ` Arnout Vandecappelle
  2015-05-02 12:15       ` Floris Bos
@ 2015-05-02 15:09       ` Floris Bos
  1 sibling, 0 replies; 18+ messages in thread
From: Floris Bos @ 2015-05-02 15:09 UTC (permalink / raw)
  To: buildroot

On 05/02/2015 09:49 AM, Arnout Vandecappelle wrote:
> On 02/05/15 01:08, Floris Bos wrote:
>> On 05/02/2015 12:23 AM, Arnout Vandecappelle wrote:
>>> On 01/05/15 20:12, Floris Bos wrote:
>>>> Prevent a warning being logged each time a PHP date/time method is
>>>> used by setting UTC as (default) timezone in php.ini
>>>>
>>>> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
>>>> ---
>>>>    package/php/php.mk | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/package/php/php.mk b/package/php/php.mk
>>>> index 3b9a117..7bd3f63 100644
>>>> --- a/package/php/php.mk
>>>> +++ b/package/php/php.mk
>>>> @@ -288,6 +288,7 @@ define PHP_INSTALL_FIXUP
>>>>        rm -f $(TARGET_DIR)/usr/bin/phpize
>>>>        $(INSTALL) -D -m 0755 $(PHP_DIR)/php.ini-production \
>>>>            $(TARGET_DIR)/etc/php.ini
>>>> +    $(SED) 's/;date.timezone =/date.timezone = UTC/' $(TARGET_DIR)/etc/php.ini
>>>    Would it be possible to use BR2_TARGET_LOCALTIME (if set) instead? Something
>>> like:
>>>
>>> ifeq ($(BR2_TARGET_LOCALTIME),)
>>> PHP_LOCALTIME = UTC
>>> else
>>> PHP_LOCALTIME = $(BR2_TARGET_LOCALTIME)
>>> endif
>>>
>>>      $(SED) 's%;date.timezone =.*%date.timezone = $(PHP_LOCALTIME)%' \
>>>          $(TARGET_DIR)/etc/php.ini
>>>
>>>    That is, assuming that php can deal with complex timezones like
>>> Europe/Brussels.
>> PHP used to use the system's time zone name automatically in older PHP versions.
>> But nowadays fills your log with warnings that is not reliable:
>>
>> ==
>> Warning: strtotime(): It is not safe to rely on the system's timezone settings.
>   Any idea _why_ it is not safe? I've tried to google it but didn't come up with
> a reason, just a lot of fixes.

I just read: 
http://derickrethans.nl/distributions-please-dont-cripple-php-or-red-hat-stop-fucking-around.html

And the problem seem to just be that there isn't a standardized way to 
retrieve the exact timezone name set on a system, only derived information.
If you have Europe/London set on your system in the winter, PHP's old 
time zone detection algorithm would only be able to detect that it is 
currently "UTC" instead of that the timezone is set to London.
I can imagine that indeed gives problems if you have PHP code that works 
with time and date values in the past or future, and needs to take into 
account day light savings time.

That means there are only problems with the detection, and not really 
with the time zone names (except the exotic ones).
And there should be no problem just specifying BR2_TARGET_LOCALTIME in 
php.ini like you suggested.

-- 
Yours sincerely,

Floris Bos

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration
  2015-05-01 18:12 ` [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration Floris Bos
@ 2015-05-02 21:17   ` Arnout Vandecappelle
  0 siblings, 0 replies; 18+ messages in thread
From: Arnout Vandecappelle @ 2015-05-02 21:17 UTC (permalink / raw)
  To: buildroot

On 01/05/15 20:12, Floris Bos wrote:
> If both lighttpd and php-fpm are selected, offer to
> enable PHP in the lighttpd configuration.
> 
> Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
> ---
>  package/lighttpd/Config.in    | 20 ++++++++++++++++++++
>  package/lighttpd/fastcgi.conf |  2 ++
>  package/lighttpd/lighttpd.mk  | 11 +++++++++++
>  3 files changed, 33 insertions(+)
>  create mode 100644 package/lighttpd/fastcgi.conf
> 
> diff --git a/package/lighttpd/Config.in b/package/lighttpd/Config.in
> index 2c101e7..e984ef8 100644
> --- a/package/lighttpd/Config.in
> +++ b/package/lighttpd/Config.in
> @@ -56,4 +56,24 @@ config BR2_PACKAGE_LIGHTTPD_LUA
>  	help
>  	  Enable Lua support. Needed to support mod_magnet
>  
> +config BR2_PACKAGE_LIGHTTPD_PHP_FPM
> +	bool "enable php in configuration"
> +	depends on BR2_PACKAGE_PHP

 This is unneeded (implied by the one below)

> +	depends on BR2_PACKAGE_PHP_FPM
> +	default "y"

 We don't put "" around y

> +	help
> +	  Configure lighttpd to handle PHP requests through php-fpm.
> +
> +	  Also enables allow-x-send-file, allowing you to offload static file sending

 This line is too long

> +	  to lighttpd with PHP code like:
> +
> +	  header("X-Send-File: /path/to/file");
> +
> +	  This is a necessity for letting the user download larger files, as
> +	  lighttpd buffers all PHP script output infinitely to memory, and
> +	  may run out if you use the normal readfile() method to output files.
> +
> +comment "php support depends on php with FPM sapi"
> +	depends on !BR2_PACKAGE_PHP || !BR2_PACKAGE_PHP_FPM

 And I'd make this
	depends on BR2_PACKAGE_PHP && !BR2_PACKAGE_PHP_FPM

The user will be smart enough to enable php if he needs is, so no comment needed
for that. But he may not be smart enough to enable FPM. And FPM is part of a
choice so you can't select it (well actually it's not really part of the choice
so you can select it, but it would be a little weird to say the least).


 Regards,
 Arnout

> +
>  endif
> diff --git a/package/lighttpd/fastcgi.conf b/package/lighttpd/fastcgi.conf
> new file mode 100644
> index 0000000..46c5f9a
> --- /dev/null
> +++ b/package/lighttpd/fastcgi.conf
> @@ -0,0 +1,2 @@
> +server.modules += ( "mod_fastcgi" )
> +fastcgi.server  = ( ".php" => (( "socket" => "/var/run/php-fpm.sock", "allow-x-send-file" => "enable" )) )
> diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
> index 626cd69..16ca88b 100644
> --- a/package/lighttpd/lighttpd.mk
> +++ b/package/lighttpd/lighttpd.mk
> @@ -77,6 +77,17 @@ endef
>  
>  LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
>  
> +ifeq ($(BR2_PACKAGE_LIGHTTPD_PHP_FPM),y)
> +define LIGHTTPD_INSTALL_FASTCGI_CONFIG
> +	$(INSTALL) -D -m 0644 package/lighttpd/fastcgi.conf \
> +		$(TARGET_DIR)/etc/lighttpd/conf.d/fastcgi.conf
> +	$(SED) '/#include \"conf.d\/fastcgi.conf\"/s/^#//' \
> +		$(TARGET_DIR)/etc/lighttpd/modules.conf
> +endef
> +
> +LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_FASTCGI_CONFIG
> +endif
> +
>  define LIGHTTPD_INSTALL_INIT_SYSV
>  	$(INSTALL) -D -m 0755 package/lighttpd/S50lighttpd \
>  		$(TARGET_DIR)/etc/init.d/S50lighttpd
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-05-02 21:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01 18:12 [Buildroot] [PATCH] php.ini: set date.timezone to UTC Floris Bos
2015-05-01 18:12 ` [Buildroot] [PATCH v2 1/3] php: fpm sapi: install startup script Floris Bos
2015-05-01 22:34   ` Arnout Vandecappelle
2015-05-01 22:58     ` Floris Bos
2015-05-01 23:06       ` Arnout Vandecappelle
2015-05-01 23:07   ` Arnout Vandecappelle
2015-05-02  7:44   ` Thomas Petazzoni
2015-05-01 18:12 ` [Buildroot] [PATCH v2 2/3] php: fpm sapi: install php-fpm.conf Floris Bos
2015-05-01 22:36   ` Arnout Vandecappelle
2015-05-02  7:45   ` Thomas Petazzoni
2015-05-01 18:12 ` [Buildroot] [PATCH v2 3/3] lighttpd: add option to enable php-fpm configuration Floris Bos
2015-05-02 21:17   ` Arnout Vandecappelle
2015-05-01 22:23 ` [Buildroot] [PATCH] php.ini: set date.timezone to UTC Arnout Vandecappelle
2015-05-01 23:08   ` Floris Bos
2015-05-02  7:49     ` Arnout Vandecappelle
2015-05-02 12:15       ` Floris Bos
2015-05-02 12:18         ` Gustavo Zacarias
2015-05-02 15:09       ` Floris Bos

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.