Do You Support $_Server['DOCUMENT_ROOT'] ?

$_Server['DOCUMENT_ROOT'] is referring to doc_root value in php.ini which is currently set to null as IIS is not returning the value. This value can only be set if the domain is hosted under a dedicated server. In addition to the security consideration, if this value is set, it will applied to to server wide. All other users who used this variable in their PHP application will be referring to a dedicated domain physical path set in the php.ini allowing other users to query the files listed on your domain.
 
You may use the 'PATH_TRANSLATED' predefined variable which will return the translated path to the current script. However, this predefined variable does not return the DOCUMENT_ROOT path.
 
You may create a sample php file in your /wwwroot with the following scripts and browse it from the web browser to get the value:
 
<?php
 echo $_SERVER['PATH_TRANSLATED'];
?> 

  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Related Articles

Safe Mode and open_basedir

Safe ModeThe PHP safe mode is an attempt to solve the shared environment server security problem....

PHP Send Mail (HTML) Script

  Line No Coding 1 2 $to = 'user1@OtherDomain.com' . ','; //Specify...

Enable display_errors In PHP

Enable display_errors For PHP The web server by default do not have the display_errors turned on...

Enable PHP with Register Globals Turned On

This setting applied to both PHP version 4.x and 5.x. After this tutorials, you will be able to...

PHP increase the session timeout

If you wish to increase the session timeout, you may include the following command line in to the...