简体   繁体   English

Docker:如何更新容器内部php.ini中的更改

[英]Docker: how to update changes in php.ini inside of container

I have a docker container which has php5.6 inside. 我有一个里面有php5.6容器。 When I test some things I get this error : strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. 当我测试某些东西时,会出现以下错误: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. This can be changed with appending date.timezone = America/New_York to my php.ini file. 可以通过将date.timezone = America/New_York附加到我的php.ini文件中来进行更改。 That's exactly what I am doing. 那正是我在做什么。 But it is not working, it seems, that I should restart some service to really "update" my php.ini file. 但是,看来我应该重新启动某些服务以真正“更新”我的php.ini文件,这是行不通的。 So, what should I do to update my php.ini file changes ? 那么,我该怎么做才能更新php.ini文件更改?

So, what should I do to update my php.ini file changes ? 那么,我该怎么做才能更新php.ini文件更改?

change your source php.ini file and re-build your image 更改您的源php.ini文件并重新生成图像

if you change the file in teh container itself, the moment you stop the container and restart it, the change will be gone. 如果您在容器本身中更改文件,则在停止容器并重新启动容器时,更改将消失。

so, you need to update your php.ini file from your source and then rebuild the image to include this change 因此,您需要从源代码更新php.ini文件,然后重建映像以包含此更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM