You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I think there was a combination of factors causing this for me.
I'm fairly confident there's an extra space after the first equals sign in the sed statement above that is preventing the match to the date.timezone...
Changing to this...
if [ ! -z "$PHP_DATE_TIMEZONE" ]; then sed -i "s/\;\?\\s\?date.timezone =.*/date.timezone = $PHP_DATE_TIMEZONE/" /etc/php7/php.ini && echo "Set PHP date.timezone = $PHP_DATE_TIMEZONE..."; fi
That now catches it.
On top of that I was specifying my timezone env flag in the docker-compose like this...
- PHP_DATE_TIMEZONE=Australia/Perth
Or like this...
- PHP_DATE_TIMEZONE=Australia\/Perth
Neither worked. It needs to be this...
- 'PHP_DATE_TIMEZONE=Australia\/Perth'
(Notice both the escaping of the forward slash AND the single quotes around the whole key pair.
This is all super fiddly but the above now works consistently. Maybe it'll help someone else.
start.sh generates an error:
sed: bad option in substitution expression
I thought it might be caused by PHP configs containing dots...
e.g.
if [ ! -z "$PHP_DATE_TIMEZONE" ]; then sed -i "s/\;\?\\s\?date.timezone = .*/date.timezone = $PHP_DATE_TIMEZONE/" /etc/php7/php.ini && echo "Set PHP date.timezone = $PHP_DATE_TIMEZONE..."; fi
But I've tried escaping the dots in the config name and it doesn't fix reliably (I'm getting inconsistent results, not sure exactly what's going on).
The text was updated successfully, but these errors were encountered: