all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file' configuration.
@ 2020-05-25 16:48 Jelle Licht
  2020-05-25 17:11 ` Jonathan Brielmaier
  2020-05-25 18:58 ` [bug#41529] [PATCH v2] " Jelle Licht
  0 siblings, 2 replies; 5+ messages in thread
From: Jelle Licht @ 2020-05-25 16:48 UTC (permalink / raw)
  To: 41529

* 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





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

* [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file' configuration.
  2020-05-25 16:48 [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file' configuration Jelle Licht
@ 2020-05-25 17:11 ` Jonathan Brielmaier
  2020-05-25 18:58 ` [bug#41529] [PATCH v2] " Jelle Licht
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Brielmaier @ 2020-05-25 17:11 UTC (permalink / raw)
  To: 41529

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!




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

* [bug#41529] [PATCH v2] services: php-fpm: Add 'php-ini-file' configuration.
  2020-05-25 16:48 [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file' configuration Jelle Licht
  2020-05-25 17:11 ` Jonathan Brielmaier
@ 2020-05-25 18:58 ` Jelle Licht
  2020-09-09 21:02   ` Ludovic Courtès
  1 sibling, 1 reply; 5+ messages in thread
From: Jelle Licht @ 2020-05-25 18:58 UTC (permalink / raw)
  To: 41529

* 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





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

* [bug#41529] [PATCH v2] services: php-fpm: Add 'php-ini-file' configuration.
  2020-05-25 18:58 ` [bug#41529] [PATCH v2] " Jelle Licht
@ 2020-09-09 21:02   ` Ludovic Courtès
  2020-09-10  7:49     ` bug#41529: " Jelle Licht
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2020-09-09 21:02 UTC (permalink / raw)
  To: Jelle Licht; +Cc: 41529

Hi Jelle,

Jelle Licht <jlicht@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’.




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

* bug#41529: [PATCH v2] services: php-fpm: Add 'php-ini-file' configuration.
  2020-09-09 21:02   ` Ludovic Courtès
@ 2020-09-10  7:49     ` Jelle Licht
  0 siblings, 0 replies; 5+ messages in thread
From: Jelle Licht @ 2020-09-10  7:49 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41529-done


Ludovic Courtès <ludo@gnu.org> writes:
>
> Jelle Licht <jlicht@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.




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

end of thread, other threads:[~2020-09-10  7:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-25 16:48 [bug#41529] [PATCH] services: php-fpm: Add 'php-ini-file' configuration Jelle Licht
2020-05-25 17:11 ` Jonathan Brielmaier
2020-05-25 18:58 ` [bug#41529] [PATCH v2] " Jelle Licht
2020-09-09 21:02   ` Ludovic Courtès
2020-09-10  7:49     ` bug#41529: " Jelle Licht

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

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.