Skip to contentSkip to conversation

PHP-FPM support

PATCH New Jordi Llonch 2 participants 4 messages Jul 14, 2014 – Jul 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PHP-FPM support

---
 package/php/Config.in | 16 ++++++++++++++++
 package/php/php.mk    |  1 +
 2 files changed, 17 insertions(+)
package/php/Config.in +16 -0
index 46444a5..5b66368 100644
@@ -17,6 +17,9 @@ config BR2_PACKAGE_PHP_CLI
 config BR2_PACKAGE_PHP_CGI
 	bool
 
+config BR2_PACKAGE_PHP_FPM
+        bool
+
 choice
 	prompt "Interface"
 	default BR2_PACKAGE_PHP_SAPI_CGI
@@ -37,6 +40,12 @@ config BR2_PACKAGE_PHP_SAPI_CLI
 	help
 	  Command Line Interface
 
+config BR2_PACKAGE_PHP_SAPI_FPM
+	bool "FPM"
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  PHP-FPM (FastCGI Process Manager)
+
 config BR2_PACKAGE_PHP_SAPI_CLI_CGI
 	bool "CGI and CLI"
 	# CGI uses fork()
@@ -46,6 +55,13 @@ config BR2_PACKAGE_PHP_SAPI_CLI_CGI
 	help
 	  Command line and Common gateway interfaces
 
+config BR2_PACKAGE_PHP_SAPI_CLI_FPM
+	bool "FPM and CLI"
+	select BR2_PACKAGE_PHP_CLI
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  Command line and PHP-FPM (FastCGI Process Manager)
+
 endchoice
 
 endif
package/php/php.mk +1 -0
index 4d3aa7d..42c1e89 100644
@@ -47,6 +47,7 @@ endif
 
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CLI),,--disable-cli)
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)
+PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm --disable-cgi,--disable--fpm)
 
 ### Extensions
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 PHP-FPM support

On 07/14/2014 04:15 PM, Jordi Llonch wrote:

Hi, let's look at this.

package/php/Config.in config BR2_PACKAGE_PHP_SAPI_CLI · line 48

Quoted 6 lines
package/php/Config.in +6 -0
+config BR2_PACKAGE_PHP_SAPI_FPM
+	bool "FPM"
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  PHP-FPM (FastCGI Process Manager)
+

Pretty sure it depends on MMU just like CGI does.

package/php/Config.in config BR2_PACKAGE_PHP_SAPI_CLI_CGI · line 64

Quoted 7 lines
package/php/Config.in +7 -0
+config BR2_PACKAGE_PHP_SAPI_CLI_FPM
+	bool "FPM and CLI"
+	select BR2_PACKAGE_PHP_CLI
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  Command line and PHP-FPM (FastCGI Process Manager)
+

Another option for FPM alone would be good too, not everyone needs CLI and php binaries are somewhat big.

Quoted 1 line

+PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm --disable-cgi,--disable--fpm)

This should focus on just enable/disabling it's own option, cgi disables itself via:

PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)

So no need to re-state that.
Regards.

#2 lore raw

PATCH 1/1 PHP-FPM support

Thanks Gustavo,
This is my first contribution to the project and I appreciate your guidance.

Will those changes suit better?

---
 package/php/Config.in | 18 ++++++++++++++++++
 package/php/php.mk    |  1 +
 2 files changed, 19 insertions(+)
package/php/Config.in +18 -0
index 46444a5..4ee14c3 100644
@@ -17,6 +17,9 @@ config BR2_PACKAGE_PHP_CLI
 config BR2_PACKAGE_PHP_CGI
 	bool
 
+config BR2_PACKAGE_PHP_FPM
+        bool
+
 choice
 	prompt "Interface"
 	default BR2_PACKAGE_PHP_SAPI_CGI
@@ -37,6 +40,13 @@ config BR2_PACKAGE_PHP_SAPI_CLI
 	help
 	  Command Line Interface
 
+config BR2_PACKAGE_PHP_SAPI_FPM
+	bool "FPM"
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  PHP-FPM (FastCGI Process Manager)
+
 config BR2_PACKAGE_PHP_SAPI_CLI_CGI
 	bool "CGI and CLI"
 	# CGI uses fork()
@@ -46,6 +56,14 @@ config BR2_PACKAGE_PHP_SAPI_CLI_CGI
 	help
 	  Command line and Common gateway interfaces
 
+config BR2_PACKAGE_PHP_SAPI_CLI_FPM
+	bool "FPM and CLI"
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_PHP_CLI
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  Command line and PHP-FPM (FastCGI Process Manager)
+
 endchoice
 
 endif
package/php/php.mk +1 -0
index 4d3aa7d..5a91f9c 100644
@@ -47,6 +47,7 @@ endif
 
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CLI),,--disable-cli)
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)
+PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm,--disable--fpm)
 
 ### Extensions
 PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \

--
1.9.1

El 15/07/2014, a las 08:28, Gustavo Zacarias <[email protected]> escribi?:

Quoted 34 lines · Jordi Llonch

Hi, let's look at this.

Review

Quoted 6 lines
(quoted diff) +6 -0
+config BR2_PACKAGE_PHP_SAPI_FPM
+	bool "FPM"
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  PHP-FPM (FastCGI Process Manager)
+

Pretty sure it depends on MMU just like CGI does.

Review

Quoted 7 lines
(quoted diff) +7 -0
+config BR2_PACKAGE_PHP_SAPI_CLI_FPM
+	bool "FPM and CLI"
+	select BR2_PACKAGE_PHP_CLI
+	select BR2_PACKAGE_PHP_FPM
+	help
+	  Command line and PHP-FPM (FastCGI Process Manager)
+

Another option for FPM alone would be good too, not everyone needs CLI and php binaries are somewhat big.

Quoted 1 line

+PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm --disable-cgi,--disable--fpm)

This should focus on just enable/disabling it's own option, cgi disables itself via:

PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_CGI),,--disable-cgi)

So no need to re-state that.
Regards.

#3 lore raw

PATCH 1/1 PHP-FPM support

Quoted 4 lines · Jordi Llonch

Thanks Gustavo,
This is my first contribution to the project and I appreciate your guidance.

Will those changes suit better?

Yes, contributions are always welcome, i never added fpm because i don't use it for my embedded cases.
There's a small typo...

Quoted 1 line

+PHP_CONF_OPT += $(if $(BR2_PACKAGE_PHP_FPM),--enable-fpm,--disable--fpm)

...an extra - in --disable-fpm :)
Otherwise looks good, care to resend with that tiny fix? Thanks.
Regards.