更新时间:2023-02-22 20:23:41
我仍在研究为什么MAMP覆盖php.ini date.timezone设置的原因和方式,但是,我在Symfony php中找到了快速解决方案文件,至少在目前为止,该文件已解决了该问题.
I am still working on figuring out why and how MAMP overrides the php.ini date.timezone settings, however, I have found the quick fix solution within Symfony php files, which solved the problem, at least for now.
我添加了以下代码:
date_default_timezone_set ('America/New_York');
-在Symfony的config.php和app_dev.php文件的顶部,紧接在脚本顶部的php标签之后.这消除了警告消息,并使Symfony在MAMP上工作.
-- at the top of Symfony's config.php and app_dev.php files, immediately after the opening php tag, at the very top of the script. This removed the warning message and got Symfony working on MAMP.
我预见到必须不断将相同的代码添加到Symfony中的其他php文件中,因为我一直对此进行黑客攻击,这应该不是问题.或者,我可能会弄清楚如何覆盖MAMP的覆盖.
I foresee having to add the same code to some other php files inside Symfony as I keep hacking at it, which shouldn't be a problem. Or I may figure out how to override MAMP's overriding.
仍然,这是一个可行的解决方案.
Still, this is a workable solution.