Skip to content

Commit

Permalink
Add PHP_DATETIMEZONE as ENV Variable (#33)
Browse files Browse the repository at this point in the history
* ADD PHP_DATETIMEZONE to ENV Tabel

* Add PHP_DATETIMEZONE to default env

* Use PHP_DATETIMEZONE in custom.ini

* update consistent env variable in README.md

* update README with better descrption of new ENV variable

* add default variable from date.timezone in php.ini

* cleanup readme table

* update to lower case

* update to lower case

* update to lower case
  • Loading branch information
holzi1005 authored Nov 20, 2024
1 parent 71c104a commit 3eec962
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ ENV nginx_root_directory=/var/www/html \
memory_limit=128M \
post_max_size=8M \
upload_max_filesize=2M \
zlib_output_compression=On
zlib_output_compression=On \
date_timezone=UTC
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ You can define the next environment variables to change values from NGINX and PH
| PHP8 | post_max_size | 8M | Max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size. |
| PHP8 | upload_max_filesize | 2M | Maximum size of an uploaded file. |
| PHP8 | zlib_output_compression | On | Whether to transparently compress pages. If this option is set to "On" in php.ini or the Apache configuration, pages are compressed if the browser sends an "Accept-Encoding: gzip" or "deflate" header. |
| PHP8 | date_timezone | UTC | Sets the PHP timezone configuration (date.timezone) in custom.ini. Accepts standard PHP timezone identifiers (e.g., 'America/New_York', 'Europe/London'). See [PHP timezones](https://www.php.net/manual/en/timezones.php) for valid values. |

_Note; Because `-v` requires an absolute path I've added `pwd` in the example to return the absolute path to the current directory_

Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/php83/conf.d/custom.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Date]
date.timezone="UTC"
date.timezone="${date_timezone:-UTC}"

allow_url_fopen = $allow_url_fopen
allow_url_include= $allow_url_include
Expand Down

0 comments on commit 3eec962

Please sign in to comment.