When safe mode is enabled, you can restrict which operating system - level environment variables users can modify through PHP scripts with the safe_mode_allowed_ env_vars directive. For example, setting this directive as follows limits modification to only those variables with a PHP_ prefix:

safe_mode_allowed_env_vars = "PHP_"

Keep in mind that leaving this directive blank means that the user can modify any environment variable.