1. 问题,打印$_ENV为空,thinkphp env()函数和ENV::get()都获取不到系统的环境变量
在docker运行环境的时候,指定了环境变量, 可以使用getenv()函数获取, 也可以在php.ini中修改配置 variables_order = "EGPCS"
This directive determines which super global arrays are registered when PHPstarts up. G,P,C,E & S are abbreviations for the following respective superglobals: GET, POST, COOKIE, ENV and SERVER. There is a performance penaltypaid for the registration of these arrays and because ENV is not as commonly used as the others, ENV is not recommended on productions servers. You can still get access to the environment variables through getenv() should you need to.
标签:get,variables,ENV,thinkphp,php,环境变量 From: https://www.cnblogs.com/jackduan/p/17451354.html