SlideShare a Scribd company logo
1 of 2
Environment variables: $_ENV
These variables are imported into PHP's global namespace from the environment
under which the PHP parser is running. Many are provided by the shell under
which PHP is running and different systems are likely running different kinds of
shells.

This is a 'superglobal', or automatic global, variable. This simply means that it is
available in all scopes throughout a script. You don't need to do a global $_ENV; to
access it within functions or methods, as you do with $HTTP_ENV_VARS.


Ex: print_r($_ENV);

       Array ( [ALLUSERSPROFILE] => C:Documents and SettingsAll Users
[APP_POOL_ID] => DefaultAppPool [ClusterLog] =>
C:WINDOWSClustercluster.log [CommonProgramFiles] => C:Program
FilesCommon Files [COMPUTERNAME] => HP [ComSpec] =>
C:WINDOWSsystem32cmd.exe [EXCHICONS] => C:Program
FilesExchsrvrbinmaildsmx.dll [NUMBER_OF_PROCESSORS] => 2 [OS] =>
Windows_NT [Path] =>
C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:Program
FilesMicrosoft SQL Server80ToolsBinn [PATHEXT] =>
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS
[PROCESSOR_ARCHITECTURE] => x86 [PROCESSOR_IDENTIFIER] => x86
Family 15 Model 4 Stepping 1, GenuineIntel [PROCESSOR_LEVEL] => 15
[PROCESSOR_REVISION] => 0401 [ProgramFiles] => C:Program Files
[SBSProgramDir] => C:Program FilesMicrosoft Windows Small Business Server
[SystemDrive] => C: [SystemRoot] => C:WINDOWS [TEMP] =>
C:WINDOWSTEMP [TMP] => C:WINDOWSTEMP [USERPROFILE] =>
C:Documents and SettingsLocalService [windir] => C:WINDOWS [winsbprogramdir]
=> C:Program FilesWindows for Small Business Server [HTTP_CACHE_CONTROL]
=> max-age=0 [HTTP_CONNECTION] => keep-alive [HTTP_KEEP_ALIVE] => 300
[HTTP_ACCEPT] =>
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/p
ng,*/*;q=0.5 [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
[HTTP_ACCEPT_ENCODING] => gzip,deflate [HTTP_ACCEPT_LANGUAGE] =>
en-us,en;q=0.5 [HTTP_COOKIE] => pma_collation_connection=utf8_general_ci;
pma_lang=en-utf-8; pma_charset=iso-8859-1; sboard_settings[current_view]=flat;
sboard_settings[member_id]=0; pmaCookieVer=4;
sboard_settings[prevvisit]=1191209984;
ff3bb5f02e118fce33304621ad6edb11=040f17700142ae81097ce46376672f4f;
125b5343fadf38be444189c79c2b7102=193cf8f3c6ff471d0d1f65160c581bd9;
PHPSESSID=9ac025834e573b31506812bae7f52374;
phpMyAdmin=24499eb5981e3fff9b229e263c36adf1; pma_fontsize=82%25;
pma_theme=original [HTTP_HOST] => hp:86 [HTTP_REFERER] =>
http://hp:86/ncdap/pro/ngolist.php [HTTP_USER_AGENT] => Mozilla/5.0 (Windows;
U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
[AUTH_TYPE] => [AUTH_PASSWORD] => [AUTH_USER] => [CERT_COOKIE]
=> [CERT_FLAGS] => [CERT_ISSUER] => [CERT_SERIALNUMBER] =>
[CERT_SUBJECT] => [CONTENT_LENGTH] => 0 [CONTENT_TYPE] =>
[GATEWAY_INTERFACE] => CGI/1.1 [HTTPS] => off [HTTPS_KEYSIZE] =>
[HTTPS_SECRETKEYSIZE] => [HTTPS_SERVER_ISSUER] =>
[HTTPS_SERVER_SUBJECT] => [INSTANCE_ID] => 7353 [LOCAL_ADDR] =>
192.168.0.4 [LOGON_USER] => [QUERY_STRING] =>
Ocode=130&page=1&section=1&name=&state= [REMOTE_ADDR] => 192.168.0.23
[REMOTE_HOST] => 192.168.0.23 [REMOTE_USER] => [REQUEST_METHOD] =>
GET [SCRIPT_NAME] => /ncdap/pro/ngodetails.php [SERVER_NAME] => hp
[SERVER_PORT] => 86 [SERVER_PORT_SECURE] => 0 [SERVER_PROTOCOL]
=> HTTP/1.1 [SERVER_SOFTWARE] => Microsoft-IIS/6.0
[UNMAPPED_REMOTE_USER] => [ORIG_PATH_TRANSLATED] =>
G:projectswebsitesncdapprongodetails.php [ORIG_PATH_INFO] =>
/ncdap/pro/ngodetails.php [ORIG_SCRIPT_NAME] => /ncdap/pro/ngodetails.php
[DOCUMENT_ROOT] => G:/projects/websites [SCRIPT_FILENAME] => G:projects
websitesncdapprongodetails.php )

More Related Content

What's hot

Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
Jussi Pohjolainen
 

What's hot (20)

Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web Programming
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For Beginners
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
 
Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18Flask - Backend com Python - Semcomp 18
Flask - Backend com Python - Semcomp 18
 
Php vulnerability presentation
Php vulnerability presentationPhp vulnerability presentation
Php vulnerability presentation
 
Web 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHPWeb 11 | AJAX + JSON + PHP
Web 11 | AJAX + JSON + PHP
 
PHP Function
PHP Function PHP Function
PHP Function
 
Psr-7
Psr-7Psr-7
Psr-7
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
File Upload
File UploadFile Upload
File Upload
 
TO Hack an ASP .NET website?
TO Hack an ASP .NET website?  TO Hack an ASP .NET website?
TO Hack an ASP .NET website?
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
Web Development Course: PHP lecture 3
Web Development Course: PHP lecture 3Web Development Course: PHP lecture 3
Web Development Course: PHP lecture 3
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Web Development Course: PHP lecture 4
Web Development Course: PHP  lecture 4Web Development Course: PHP  lecture 4
Web Development Course: PHP lecture 4
 
Perl one-liners
Perl one-linersPerl one-liners
Perl one-liners
 

Similar to Php Env Var

Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Muhamad Al Imran
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Muhamad Al Imran
 

Similar to Php Env Var (20)

Getting Started with CloudScript
Getting Started with CloudScriptGetting Started with CloudScript
Getting Started with CloudScript
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
Les02
Les02Les02
Les02
 
PHP and MySQL.ppt
PHP and MySQL.pptPHP and MySQL.ppt
PHP and MySQL.ppt
 
My Saminar On Php
My Saminar On PhpMy Saminar On Php
My Saminar On Php
 
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin BačovskýOSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
OSCamp #4 on Foreman | CLI tools with Foreman by Martin Bačovský
 
SecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAPSecZone 2011: Scrubbing SAP clean with SOAP
SecZone 2011: Scrubbing SAP clean with SOAP
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
SAP (in)security: Scrubbing SAP clean with SOAP
SAP (in)security: Scrubbing SAP clean with SOAPSAP (in)security: Scrubbing SAP clean with SOAP
SAP (in)security: Scrubbing SAP clean with SOAP
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
php 1
php 1php 1
php 1
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Sa
SaSa
Sa
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Asp.net tips
Asp.net tipsAsp.net tips
Asp.net tips
 
Session Server - Maintaing State between several Servers
Session Server - Maintaing State between several ServersSession Server - Maintaing State between several Servers
Session Server - Maintaing State between several Servers
 
Como ser um bom administrador de team foundation server vinicius moura
Como ser um bom administrador de team foundation server   vinicius mouraComo ser um bom administrador de team foundation server   vinicius moura
Como ser um bom administrador de team foundation server vinicius moura
 

Php Env Var

  • 1. Environment variables: $_ENV These variables are imported into PHP's global namespace from the environment under which the PHP parser is running. Many are provided by the shell under which PHP is running and different systems are likely running different kinds of shells. This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. You don't need to do a global $_ENV; to access it within functions or methods, as you do with $HTTP_ENV_VARS. Ex: print_r($_ENV); Array ( [ALLUSERSPROFILE] => C:Documents and SettingsAll Users [APP_POOL_ID] => DefaultAppPool [ClusterLog] => C:WINDOWSClustercluster.log [CommonProgramFiles] => C:Program FilesCommon Files [COMPUTERNAME] => HP [ComSpec] => C:WINDOWSsystem32cmd.exe [EXCHICONS] => C:Program FilesExchsrvrbinmaildsmx.dll [NUMBER_OF_PROCESSORS] => 2 [OS] => Windows_NT [Path] => C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:Program FilesMicrosoft SQL Server80ToolsBinn [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS [PROCESSOR_ARCHITECTURE] => x86 [PROCESSOR_IDENTIFIER] => x86 Family 15 Model 4 Stepping 1, GenuineIntel [PROCESSOR_LEVEL] => 15 [PROCESSOR_REVISION] => 0401 [ProgramFiles] => C:Program Files [SBSProgramDir] => C:Program FilesMicrosoft Windows Small Business Server [SystemDrive] => C: [SystemRoot] => C:WINDOWS [TEMP] => C:WINDOWSTEMP [TMP] => C:WINDOWSTEMP [USERPROFILE] => C:Documents and SettingsLocalService [windir] => C:WINDOWS [winsbprogramdir] => C:Program FilesWindows for Small Business Server [HTTP_CACHE_CONTROL] => max-age=0 [HTTP_CONNECTION] => keep-alive [HTTP_KEEP_ALIVE] => 300 [HTTP_ACCEPT] => text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/p ng,*/*;q=0.5 [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 [HTTP_ACCEPT_ENCODING] => gzip,deflate [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 [HTTP_COOKIE] => pma_collation_connection=utf8_general_ci; pma_lang=en-utf-8; pma_charset=iso-8859-1; sboard_settings[current_view]=flat; sboard_settings[member_id]=0; pmaCookieVer=4; sboard_settings[prevvisit]=1191209984; ff3bb5f02e118fce33304621ad6edb11=040f17700142ae81097ce46376672f4f; 125b5343fadf38be444189c79c2b7102=193cf8f3c6ff471d0d1f65160c581bd9; PHPSESSID=9ac025834e573b31506812bae7f52374; phpMyAdmin=24499eb5981e3fff9b229e263c36adf1; pma_fontsize=82%25; pma_theme=original [HTTP_HOST] => hp:86 [HTTP_REFERER] =>
  • 2. http://hp:86/ncdap/pro/ngolist.php [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 [AUTH_TYPE] => [AUTH_PASSWORD] => [AUTH_USER] => [CERT_COOKIE] => [CERT_FLAGS] => [CERT_ISSUER] => [CERT_SERIALNUMBER] => [CERT_SUBJECT] => [CONTENT_LENGTH] => 0 [CONTENT_TYPE] => [GATEWAY_INTERFACE] => CGI/1.1 [HTTPS] => off [HTTPS_KEYSIZE] => [HTTPS_SECRETKEYSIZE] => [HTTPS_SERVER_ISSUER] => [HTTPS_SERVER_SUBJECT] => [INSTANCE_ID] => 7353 [LOCAL_ADDR] => 192.168.0.4 [LOGON_USER] => [QUERY_STRING] => Ocode=130&page=1&section=1&name=&state= [REMOTE_ADDR] => 192.168.0.23 [REMOTE_HOST] => 192.168.0.23 [REMOTE_USER] => [REQUEST_METHOD] => GET [SCRIPT_NAME] => /ncdap/pro/ngodetails.php [SERVER_NAME] => hp [SERVER_PORT] => 86 [SERVER_PORT_SECURE] => 0 [SERVER_PROTOCOL] => HTTP/1.1 [SERVER_SOFTWARE] => Microsoft-IIS/6.0 [UNMAPPED_REMOTE_USER] => [ORIG_PATH_TRANSLATED] => G:projectswebsitesncdapprongodetails.php [ORIG_PATH_INFO] => /ncdap/pro/ngodetails.php [ORIG_SCRIPT_NAME] => /ncdap/pro/ngodetails.php [DOCUMENT_ROOT] => G:/projects/websites [SCRIPT_FILENAME] => G:projects websitesncdapprongodetails.php )