services: php-fpm: Add 'php-ini-file' configuration.
* 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.master
parent
cafbc5f390
commit
bba0533115
|
@ -22191,6 +22191,31 @@ Can be set to @code{#f} to disable logging.
|
||||||
@item @code{file} (default @code{#f})
|
@item @code{file} (default @code{#f})
|
||||||
An optional override of the whole configuration.
|
An optional override of the whole configuration.
|
||||||
You can use the @code{mixed-text-file} function or an absolute filepath for it.
|
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 table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,7 @@
|
||||||
php-fpm-configuration-timezone
|
php-fpm-configuration-timezone
|
||||||
php-fpm-configuration-workers-log-file
|
php-fpm-configuration-workers-log-file
|
||||||
php-fpm-configuration-file
|
php-fpm-configuration-file
|
||||||
|
php-fpm-configuration-php-ini-file
|
||||||
|
|
||||||
php-fpm-dynamic-process-manager-configuration
|
php-fpm-dynamic-process-manager-configuration
|
||||||
make-php-fpm-dynamic-process-manager-configuration
|
make-php-fpm-dynamic-process-manager-configuration
|
||||||
|
@ -856,6 +857,8 @@ of index files."
|
||||||
(version-major (package-version php))
|
(version-major (package-version php))
|
||||||
"-fpm.www.log")))
|
"-fpm.www.log")))
|
||||||
(file php-fpm-configuration-file ;#f | file-like
|
(file php-fpm-configuration-file ;#f | file-like
|
||||||
|
(default #f))
|
||||||
|
(php-ini-file php-fpm-configuration-php-ini-file ;#f | file-like
|
||||||
(default #f)))
|
(default #f)))
|
||||||
|
|
||||||
(define-record-type* <php-fpm-dynamic-process-manager-configuration>
|
(define-record-type* <php-fpm-dynamic-process-manager-configuration>
|
||||||
|
@ -962,7 +965,7 @@ of index files."
|
||||||
(match-lambda
|
(match-lambda
|
||||||
(($ <php-fpm-configuration> php socket user group socket-user socket-group
|
(($ <php-fpm-configuration> php socket user group socket-user socket-group
|
||||||
pid-file log-file pm display-errors
|
pid-file log-file pm display-errors
|
||||||
timezone workers-log-file file)
|
timezone workers-log-file file php-ini-file)
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(provision '(php-fpm))
|
(provision '(php-fpm))
|
||||||
(documentation "Run the php-fpm daemon.")
|
(documentation "Run the php-fpm daemon.")
|
||||||
|
@ -973,7 +976,10 @@ of index files."
|
||||||
#$(or file
|
#$(or file
|
||||||
(default-php-fpm-config socket user group
|
(default-php-fpm-config socket user group
|
||||||
socket-user socket-group pid-file log-file
|
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))
|
#:pid-file #$pid-file))
|
||||||
(stop #~(make-kill-destructor)))))))
|
(stop #~(make-kill-destructor)))))))
|
||||||
|
|
||||||
|
|
Reference in New Issue