From patchwork Mon May 25 18:58:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jelle Licht X-Patchwork-Id: 22361 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A082627BBE3; Mon, 25 May 2020 19:59:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 26F7427BBE1 for ; Mon, 25 May 2020 19:59:59 +0100 (BST) Received: from localhost ([::1]:33740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdIKM-0003HJ-Jx for patchwork@mira.cbaines.net; Mon, 25 May 2020 14:59:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdIJS-0002fv-B8 for guix-patches@gnu.org; Mon, 25 May 2020 14:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdIJS-0008Q2-12 for guix-patches@gnu.org; Mon, 25 May 2020 14:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdIJS-0006IZ-09 for guix-patches@gnu.org; Mon, 25 May 2020 14:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41529] [PATCH v2] services: php-fpm: Add 'php-ini-file' configuration. References: <20200525164845.9012-1-jlicht@fsfe.org> In-Reply-To: <20200525164845.9012-1-jlicht@fsfe.org> Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 May 2020 18:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41529 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41529@debbugs.gnu.org Received: via spool by 41529-submit@debbugs.gnu.org id=B41529.159043313424198 (code B ref 41529); Mon, 25 May 2020 18:59:01 +0000 Received: (at 41529) by debbugs.gnu.org; 25 May 2020 18:58:54 +0000 Received: from localhost ([127.0.0.1]:42539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdIJJ-0006ID-KC for submit@debbugs.gnu.org; Mon, 25 May 2020 14:58:54 -0400 Received: from mail1.fsfe.org ([217.69.89.151]:42332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdIJI-0006I7-KL for 41529@debbugs.gnu.org; Mon, 25 May 2020 14:58:53 -0400 From: Jelle Licht Date: Mon, 25 May 2020 20:58:46 +0200 Message-Id: <20200525185846.19200-1-jlicht@fsfe.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/web.scm: ()[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 @@ -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* @@ -963,7 +966,7 @@ of index files." (match-lambda (($ 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)))))))