GNU bug report logs - #41529
[PATCH] services: php-fpm: Add 'php-ini-file' configuration.

Previous Next

Package: guix-patches;

Reported by: Jelle Licht <jlicht <at> fsfe.org>

Date: Mon, 25 May 2020 16:49:01 UTC

Severity: normal

Tags: patch

Done: Jelle Licht <jlicht <at> fsfe.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41529 in the body.
You can then email your comments to 41529 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41529; Package guix-patches. (Mon, 25 May 2020 16:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jelle Licht <jlicht <at> fsfe.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 25 May 2020 16:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: php-fpm: Add 'php-ini-file' configuration.
Date: Mon, 25 May 2020 18:48:45 +0200
* gnu/services/web.scm: (<php-fpm-configuration>)[php-ini-file]: New record field.
(php-fpm-shepherd-service): Use it.
* doc/guix.texi (Web Services): Document it.
---
 doc/guix.texi        |  4 ++++
 gnu/services/web.scm | 10 ++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3d1b097447..82ea7ae852 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21370,6 +21370,10 @@ Can be set to @code{#f} to disable logging.
 @item @code{file} (default @code{#f})
 An optional override of the whole configuration.
 You can use the @code{mixed-text-file} function or an absolute filepath for it.
+@item @code{php-ini-file} (default @code{#f})
+An optional override of the default php settings.
+It may be any ``file-like'' object (@pxref{G-Expressions, file-like objects}).
+You can use the @code{mixed-text-file} function or an absolute filepath for it.
 @end table
 @end deftp
 
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 9fcfe8a0dc..7cc53ef12f 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -159,6 +159,7 @@
             php-fpm-configuration-timezone
             php-fpm-configuration-workers-log-file
             php-fpm-configuration-file
+            php-fpm-configuration-php-ini-file
 
             <php-fpm-dynamic-process-manager-configuration>
             php-fpm-dynamic-process-manager-configuration
@@ -857,6 +858,8 @@ of index files."
                                             (version-major (package-version php))
                                             "-fpm.www.log")))
   (file             php-fpm-configuration-file ;#f | file-like
+                    (default #f))
+  (php-ini-file     php-fpm-configuration-php-ini-file ;#f | file-like
                     (default #f)))
 
 (define-record-type* <php-fpm-dynamic-process-manager-configuration>
@@ -963,7 +966,7 @@ of index files."
   (match-lambda
     (($ <php-fpm-configuration> php socket user group socket-user socket-group
                                 pid-file log-file pm display-errors
-                                timezone workers-log-file file)
+                                timezone workers-log-file file php-ini-file)
      (list (shepherd-service
             (provision '(php-fpm))
             (documentation "Run the php-fpm daemon.")
@@ -974,7 +977,10 @@ of index files."
                         #$(or file
                               (default-php-fpm-config socket user group
                                 socket-user socket-group pid-file log-file
-                                pm display-errors timezone workers-log-file)))
+                                pm display-errors timezone workers-log-file))
+                        #$@(if php-ini-file
+                               `("-c" ,php-ini-file)
+                               '()))
                       #:pid-file #$pid-file))
             (stop #~(make-kill-destructor)))))))
 
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41529; Package guix-patches. (Mon, 25 May 2020 17:12:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: guix-patches <at> gnu.org
Subject: Re: [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file'
 configuration.
Date: Mon, 25 May 2020 19:11:46 +0200
Nice Jelle!

On 25.05.20 18:48, Jelle Licht wrote:
> * gnu/services/web.scm: (<php-fpm-configuration>)[php-ini-file]: New record field.
> (php-fpm-shepherd-service): Use it.
> * doc/guix.texi (Web Services): Document it.
> ---
>  doc/guix.texi        |  4 ++++
>  gnu/services/web.scm | 10 ++++++++--
>  2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 3d1b097447..82ea7ae852 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -21370,6 +21370,10 @@ Can be set to @code{#f} to disable logging.
>  @item @code{file} (default @code{#f})
>  An optional override of the whole configuration.
>  You can use the @code{mixed-text-file} function or an absolute filepath for it.
> +@item @code{php-ini-file} (default @code{#f})
> +An optional override of the default php settings.
> +It may be any ``file-like'' object (@pxref{G-Expressions, file-like objects}).
> +You can use the @code{mixed-text-file} function or an absolute filepath for it.
>  @end table
>  @end deftp

Could you add a small simple example here. I would relaly appreciate it!




Information forwarded to guix-patches <at> gnu.org:
bug#41529; Package guix-patches. (Mon, 25 May 2020 18:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 41529 <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: 41529 <at> debbugs.gnu.org
Subject: [PATCH v2] services: php-fpm: Add 'php-ini-file' configuration.
Date: Mon, 25 May 2020 20:58:46 +0200
* gnu/services/web.scm: (<php-fpm-configuration>)[php-ini-file]: New record field.
(php-fpm-shepherd-service): Use it.
* doc/guix.texi (Web Services): Document it.
---
 doc/guix.texi        | 25 +++++++++++++++++++++++++
 gnu/services/web.scm | 10 ++++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 3d1b097447..3364b05873 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21370,6 +21370,31 @@ Can be set to @code{#f} to disable logging.
 @item @code{file} (default @code{#f})
 An optional override of the whole configuration.
 You can use the @code{mixed-text-file} function or an absolute filepath for it.
+@item @code{php-ini-file} (default @code{#f})
+An optional override of the default php settings.
+It may be any ``file-like'' object (@pxref{G-Expressions, file-like objects}).
+You can use the @code{mixed-text-file} function or an absolute filepath for it.
+
+For local development it is useful to set a higher timeout and memory
+limit for spawned php processes.  This be accomplished with the
+following operating system configuration snippet:
+@lisp
+(define %local-php-ini
+  (plain-file "php.ini"
+              "memory_limit = 2G
+max_execution_time = 1800"))
+
+(operating-system
+  ;; @dots{}
+  (services (cons (service php-fpm-service-type
+                           (php-fpm-configuration
+                            (php-ini-file %local-php-ini)))
+                  %base-services)))
+@end lisp
+
+Consult the @url{https://www.php.net/manual/en/ini.core.php,core php.ini
+directives} for comprehensive documentation on the acceptable
+@file{php.ini} directives.
 @end table
 @end deftp
 
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 9fcfe8a0dc..7cc53ef12f 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -159,6 +159,7 @@
             php-fpm-configuration-timezone
             php-fpm-configuration-workers-log-file
             php-fpm-configuration-file
+            php-fpm-configuration-php-ini-file
 
             <php-fpm-dynamic-process-manager-configuration>
             php-fpm-dynamic-process-manager-configuration
@@ -857,6 +858,8 @@ of index files."
                                             (version-major (package-version php))
                                             "-fpm.www.log")))
   (file             php-fpm-configuration-file ;#f | file-like
+                    (default #f))
+  (php-ini-file     php-fpm-configuration-php-ini-file ;#f | file-like
                     (default #f)))
 
 (define-record-type* <php-fpm-dynamic-process-manager-configuration>
@@ -963,7 +966,7 @@ of index files."
   (match-lambda
     (($ <php-fpm-configuration> php socket user group socket-user socket-group
                                 pid-file log-file pm display-errors
-                                timezone workers-log-file file)
+                                timezone workers-log-file file php-ini-file)
      (list (shepherd-service
             (provision '(php-fpm))
             (documentation "Run the php-fpm daemon.")
@@ -974,7 +977,10 @@ of index files."
                         #$(or file
                               (default-php-fpm-config socket user group
                                 socket-user socket-group pid-file log-file
-                                pm display-errors timezone workers-log-file)))
+                                pm display-errors timezone workers-log-file))
+                        #$@(if php-ini-file
+                               `("-c" ,php-ini-file)
+                               '()))
                       #:pid-file #$pid-file))
             (stop #~(make-kill-destructor)))))))
 
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41529; Package guix-patches. (Wed, 09 Sep 2020 21:04:02 GMT) Full text and rfc822 format available.

Message #14 received at 41529 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jelle Licht <jlicht <at> fsfe.org>
Cc: 41529 <at> debbugs.gnu.org
Subject: Re: [bug#41529] [PATCH v2] services: php-fpm: Add 'php-ini-file'
 configuration.
Date: Wed, 09 Sep 2020 23:02:53 +0200
Hi Jelle,

Jelle Licht <jlicht <at> fsfe.org> skribis:

> * gnu/services/web.scm: (<php-fpm-configuration>)[php-ini-file]: New record field.
> (php-fpm-shepherd-service): Use it.
> * doc/guix.texi (Web Services): Document it.

It’s been a long time already and I think you can go ahead and push it.

Thank you!

Ludo’.




Reply sent to Jelle Licht <jlicht <at> fsfe.org>:
You have taken responsibility. (Thu, 10 Sep 2020 07:50:02 GMT) Full text and rfc822 format available.

Notification sent to Jelle Licht <jlicht <at> fsfe.org>:
bug acknowledged by developer. (Thu, 10 Sep 2020 07:50:02 GMT) Full text and rfc822 format available.

Message #19 received at 41529-done <at> debbugs.gnu.org (full text, mbox):

From: Jelle Licht <jlicht <at> fsfe.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 41529-done <at> debbugs.gnu.org
Subject: Re: [bug#41529] [PATCH v2] services: php-fpm: Add 'php-ini-file'
 configuration.
Date: Thu, 10 Sep 2020 09:49:23 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:
>
> Jelle Licht <jlicht <at> fsfe.org> skribis:
>
>> * gnu/services/web.scm: (<php-fpm-configuration>)[php-ini-file]: New record field.
>> (php-fpm-shepherd-service): Use it.
>> * doc/guix.texi (Web Services): Document it.
>
> It’s been a long time already and I think you can go ahead and push it.

pushed as bba0533115df9a31b696ee3782c8054174b955b1 to master.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 Oct 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.