Skip to content

Commit

Permalink
Merge pull request #6 from rokde/master
Browse files Browse the repository at this point in the history
added php configuration values
  • Loading branch information
Robert Kummer authored Jun 1, 2017
2 parents 9b83911 + 4bd75ab commit 1c5015a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ PHP Configuration value: pm.start\_servers
PHP Configuration value: pm.min\_spare\_servers
### PHP\_MAX\_SPARE\_SERVERS
PHP Configuration value: pm.max\_spare\_servers
### PHP\_MEMORY\_LIMIT
PHP Configuration value: php_admin_value\[memory\_limit\]
### PHP_POST_MAX_SIZE
PHP Configuration value: php_admin_value\[post\_max\_size\]
### PHP_UPLOAD_MAX_FILESIZE
PHP Configuration value: php_admin_value\[upload\_max\_filesize\]

## Available includes

Expand Down
8 changes: 7 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ setDefault 'PHP_MAX_CHILDREN' 100
setDefault 'PHP_START_SERVERS' 20
setDefault 'PHP_MIN_SPARE_SERVERS' 10
setDefault 'PHP_MAX_SPARE_SERVERS' 20
setDefault 'PHP_MEMORY_LIMIT' 128M
setDefault 'PHP_POST_MAX_SIZE' 32M
setDefault 'PHP_UPLOAD_MAX_FILESIZE' 32M

sed -e "s/%%USER%%/$USER/" /opt/config/nginx.conf.tpl > /etc/nginx/nginx.conf
sed \
Expand All @@ -41,6 +44,9 @@ sed \
-e "s/%%PHP_START_SERVERS%%/$PHP_START_SERVERS/" \
-e "s/%%PHP_MIN_SPARE_SERVERS%%/$PHP_MIN_SPARE_SERVERS/" \
-e "s/%%PHP_MAX_SPARE_SERVERS%%/$PHP_MAX_SPARE_SERVERS/" \
-e "s/%%PHP_MEMORY_LIMIT%%/$PHP_MEMORY_LIMIT/" \
-e "s/%%PHP_POST_MAX_SIZE%%/$PHP_POST_MAX_SIZE/" \
-e "s/%%PHP_UPLOAD_MAX_FILESIZE%%/$PHP_UPLOAD_MAX_FILESIZE/" \
/opt/config/www.conf.tpl > /etc/php/7.0/fpm/pool.d/www.conf

for STORAGE in "${APPPATH}/storage" "${APPPATH}/app/storage" \
Expand Down Expand Up @@ -118,7 +124,7 @@ nginx -g "daemon off;" &

if [ -f $ARTISAN ] ; then
if [ -z "$NO_MIGRATE" ] ; then
echo Migrating
echo Migrating
php ${APPPATH}/artisan migrate --no-interaction --force
fi

Expand Down
42 changes: 22 additions & 20 deletions www.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ listen = /var/run/php/php-fpm.sock

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = %%USER%%
Expand All @@ -54,7 +54,7 @@ listen.group = %%USER%%
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =

; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
Expand Down Expand Up @@ -127,7 +127,7 @@ pm.max_spare_servers = %%PHP_MAX_SPARE_SERVERS%%
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
Expand Down Expand Up @@ -180,7 +180,7 @@ pm.max_spare_servers = %%PHP_MAX_SPARE_SERVERS%%
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
Expand Down Expand Up @@ -230,9 +230,9 @@ pm.max_spare_servers = %%PHP_MAX_SPARE_SERVERS%%
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
; Default Value: not set
;pm.status_path = /status

; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
Expand Down Expand Up @@ -293,7 +293,7 @@ ping.path = /ping
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
Expand All @@ -308,50 +308,50 @@ ping.path = /ping
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"

; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
;slowlog = log/$pool.log.slow

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0

; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024

; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
;chroot =

; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
chdir = /

; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
Expand All @@ -375,7 +375,7 @@ clear_env = no
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
Expand All @@ -389,7 +389,7 @@ clear_env = no
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
Expand All @@ -409,4 +409,6 @@ clear_env = no
;php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_value[error_log] = /var/log/fpm-php.log
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M
php_admin_value[memory_limit] = %%PHP_MEMORY_LIMIT%%
php_admin_value[post_max_size] = %%PHP_POST_MAX_SIZE%%
php_admin_value[upload_max_filesize] = %%PHP_UPLOAD_MAX_FILESIZE%%

0 comments on commit 1c5015a

Please sign in to comment.