Article ID: 123673, created on Nov 25, 2014, last review on Nov 25, 2014

  • Applies to:
  • APS


Configuration / verification script that uses PHP $_ENV environmental variable does not work correctly.


The $_ENV variables are imported from the environment under which PHP is running, and depending on your setup. The $_ENV is empty. The array wasn't populated because of a setting in php.ini:

; This directive determines which super global arrays are registered when PHP
; starts up. If the register_globals directive is enabled, it also determines
; what order variables are populated into the global space. G,P,C,E & S are
; abbreviations for the following respective super globals: GET, POST, COOKIE,
; ENV and SERVER. There is a performance penalty paid for the registration of
; these arrays and because ENV is not as commonly used as the others, ENV is
; is not recommended on productions servers. You can still get access to
; the environment variables through getenv() should you need to.
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS";
variables_order = "GPCS"


Set the variables_order setting in the php.ini to "EGPCS".

Search Words


PHP environmental variable


environmental variable is empty



Email subscription for changes to this article
Save as PDF