Php application path variable problem summary _ PHP Tutorial

Source: Internet
Author: User
Summary of php application path variables. Local server, domain name d.com, root path D: phpnowvhostsd.com. yii, with the requeir_onceaa.php file in the x. php code in the root directory, and aa. php requeir_onceabb.php

Local server, domain http://d.com, root path D: \ phpnow \ vhosts \ d.com. yii, which has Files/x. requeir_once/. php, and/. php and requeir_once/a/B. php

/X. php

$ _ SERVER ["HTTP_HOST"]: [d.com] // Host of the current request: Domain name information

$ _ SERVER ["PHP_SELF"]: [] //
$ _ SERVER ["SCRIPT_NAME"]: [/x. php ]//
$ _ SERVER ["SCRIPT_FILENAME"]: [D:/phpnow/vhosts/d.com. yii/x. php ]//.
_ FILE __:【]//.

$ _ SERVER ["REQUEST_URI"]: [/x. php/x/y/z.html? A = B & c = d] // all the content after/and in the url request.
$ _ SERVER ["QUERY_STRING"]: [a = B & c = d] // in the url request? .

$ _ SERVER ["DOCUMENT_ROOT"]: [D:/phpnow/vhosts/d.com. yii] // document root directory. Defined in the server configuration file

Basename ($ _ SERVER ["PHP_SELF "]): [] //
Basename ($ _ SERVER ["SCRIPT_NAME"]): [x. php] //
Basename ($ _ SERVER ["SCRIPT_FILENAME"]): [x. php] //
Basename (_ FILE _): [] //

Dirname ($ _ SERVER ["PHP_SELF "]): [] //
Dirname ($ _ SERVER ["SCRIPT_NAME "]): [\] //
Dirname ($ _ SERVER ["SCRIPT_FILENAME"]): [D:/phpnow/vhosts/d.com. yii] //
Dirname (_ FILE _): [] //

Require_once/a. php

$ _ SERVER ["HTTP_HOST"]: [d.com] // Host of the current request: Domain name information

$ _ SERVER ["PHP_SELF"]: [] //
$ _ SERVER ["SCRIPT_NAME"]: [/x. php ]//
$ _ SERVER ["SCRIPT_FILENAME"]: [D:/phpnow/vhosts/d.com. yii/x. php ]//.
_ FILE __:【]//.

$ _ SERVER ["REQUEST_URI"]: [/x. php/x/y/z.html? A = B & c = d] // all the content after/and in the url request.
$ _ SERVER ["QUERY_STRING"]: [a = B & c = d] // in the url request? .

$ _ SERVER ["DOCUMENT_ROOT"]: [D:/phpnow/vhosts/d.com. yii] // document root directory. Defined in the server configuration file

Basename ($ _ SERVER ["PHP_SELF "]): [] //
Basename ($ _ SERVER ["SCRIPT_NAME"]): [x. php] //
Basename ($ _ SERVER ["SCRIPT_FILENAME"]): [x. php] //
Basename (_ FILE _): [] //

Dirname ($ _ SERVER ["PHP_SELF "]): [] //
Dirname ($ _ SERVER ["SCRIPT_NAME "]): [\] //
Dirname ($ _ SERVER ["SCRIPT_FILENAME"]): [D:/phpnow/vhosts/d.com. yii] //
Dirname (_ FILE _): [] //

Require_once/a/B. php

$ _ SERVER ["HTTP_HOST"]: [d.com] // Host of the current request: Domain name information

$ _ SERVER ["PHP_SELF"]: [] //
$ _ SERVER ["SCRIPT_NAME"]: [/x. php ]//
$ _ SERVER ["SCRIPT_FILENAME"]: [D:/phpnow/vhosts/d.com. yii/x. php ]//.
_ FILE __:【]//.

$ _ SERVER ["REQUEST_URI"]: [/x. php/x/y/z.html? A = B & c = d] // all the content after/and in the url request.
$ _ SERVER ["QUERY_STRING"]: [a = B & c = d] // in the url request? .

$ _ SERVER ["DOCUMENT_ROOT"]: [D:/phpnow/vhosts/d.com. yii] // document root directory. Defined in the server configuration file

Basename ($ _ SERVER ["PHP_SELF "]): [] //
Basename ($ _ SERVER ["SCRIPT_NAME"]): [x. php] //
Basename ($ _ SERVER ["SCRIPT_FILENAME"]): [x. php] //
Basename (_ FILE _): [] //

Dirname ($ _ SERVER ["PHP_SELF "]): [] //
Dirname ($ _ SERVER ["SCRIPT_NAME "]): [\] //
Dirname ($ _ SERVER ["SCRIPT_FILENAME"]): [D:/phpnow/vhosts/d.com. yii] //
Dirname (_ FILE _): [] //

/A. php

$ _ SERVER ["HTTP_HOST"]: [d.com] // Host of the current request: Domain name information

$ _ SERVER ["PHP_SELF"]: [] //
$ _ SERVER ["SCRIPT_NAME"]: [/a. php ]//
$ _ SERVER ["SCRIPT_FILENAME"]: [D:/phpnow/vhosts/d.com. yii/a. php ]//.
_ FILE __:【]//.

$ _ SERVER ["REQUEST_URI"]: [/a. php/x/y/z.html? A = B & c = d] // all the content after/and in the url request.
$ _ SERVER ["QUERY_STRING"]: [a = B & c = d] // in the url request? .

$ _ SERVER ["DOCUMENT_ROOT"]: [D:/phpnow/vhosts/d.com. yii] // document root directory. Defined in the server configuration file

Basename ($ _ SERVER ["PHP_SELF "]): [] //
Basename ($ _ SERVER ["SCRIPT_NAME"]): [a. php] //
Basename ($ _ SERVER ["SCRIPT_FILENAME"]): [a. php] //
Basename (_ FILE _): [] //

Dirname ($ _ SERVER ["PHP_SELF "]): [] //
Dirname ($ _ SERVER ["SCRIPT_NAME"]): [/] //
Dirname ($ _ SERVER ["SCRIPT_FILENAME"]): [D:/phpnow/vhosts/d.com. yii/] //
Dirname (_ FILE _): [] //

Require_once/a/B. php

$ _ SERVER ["HTTP_HOST"]: [d.com] // Host of the current request: Domain name information

$ _ SERVER ["PHP_SELF"]: [] //
$ _ SERVER ["SCRIPT_NAME"]: [/a. php ]//
$ _ SERVER ["SCRIPT_FILENAME"]: [D:/phpnow/vhosts/d.com. yii/a. php ]//.
_ FILE __:【]//.

$ _ SERVER ["REQUEST_URI"]: [/a. php/x/y/z.html? A = B & c = d] // all the content after/and in the url request.
$ _ SERVER ["QUERY_STRING"]: [a = B & c = d] // in the url request? .

$ _ SERVER ["DOCUMENT_ROOT"]: [D:/phpnow/vhosts/d.com. yii] // document root directory. Defined in the server configuration file

Basename ($ _ SERVER ["PHP_SELF "]): [] //
Basename ($ _ SERVER ["SCRIPT_NAME"]): [a. php] //
Basename ($ _ SERVER ["SCRIPT_FILENAME"]): [a. php] //
Basename (_ FILE _): [] //

Dirname ($ _ SERVER ["PHP_SELF "]): [] //
Dirname ($ _ SERVER ["SCRIPT_NAME"]): [/] //
Dirname ($ _ SERVER ["SCRIPT_FILENAME"]): [D:/phpnow/vhosts/d.com. yii/] //
Dirname (_ FILE _): [] //

/X. php

 /X. php
 "'$ _ SERVER [" HTTP_HOST "]: [', ['http _ host'],"] // HOST of the current request: Domain name information ","
"'
''' $ _ SERVER ["PHP_SELF"]: [', ['php _ SELF'], "] // relative address of the request execution file ","
"'$ _ SERVER [" SCRIPT_NAME "]: [', ['script _ name']," // relative address of the actual execution file ","
"'$ _ SERVER [" SCRIPT_FILENAME "]: [', ['script _ FILENAME ']," // absolute path of the actual execution file. ","
"'_ FILE _: [',"] // absolute path of the actually executed code. ","
"'
''' $ _ SERVER ["REQUEST_URI"]: [', ['request _ URI'], "] // all the content after/and in a url REQUEST. ","
"'$ _ SERVER [" QUERY_STRING "]: [', ['query _ string'],"] // url request? . ","
"'
''' $ _ SERVER ["DOCUMENT_ROOT"]: [', ['document _ root'], "] // document root directory. Define "," in the server configuration file ","
""
"'Basename ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // file name of the file requesting execution ","
"'Basename ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name']),"] // file NAME of the actually executed file ","
"'Basename ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // file name of the actually executed file ","
"'Basename (_ FILE _): [', (),"] // FILE name of the actually executed code ","
"";"
"'Dirname ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // Directory of the request execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name'])," // Directory of the actual execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // Directory of the actual execution file ","
"'Dirname (_ FILE _): [', (),"] // Directory of the actually executed code ","
"";"
"" Require_once "(" a/a. php ");

/A. php

 "'$ _ SERVER [" HTTP_HOST "]: [', ['http _ host'],"] // HOST of the current request: Domain name information ","
"'
''' $ _ SERVER ["PHP_SELF"]: [', ['php _ SELF'], "] // relative address of the request execution file ","
"'$ _ SERVER [" SCRIPT_NAME "]: [', ['script _ name']," // relative address of the actual execution file ","
"'$ _ SERVER [" SCRIPT_FILENAME "]: [', ['script _ FILENAME ']," // absolute path of the actual execution file. ","
"'_ FILE _: [',"] // absolute path of the actually executed code. ","
"'
''' $ _ SERVER ["REQUEST_URI"]: [', ['request _ URI'], "] // all the content after/and in a url REQUEST. ","
"'$ _ SERVER [" QUERY_STRING "]: [', ['query _ string'],"] // url request? . ","
"'
''' $ _ SERVER ["DOCUMENT_ROOT"]: [', ['document _ root'], "] // document root directory. Define "," in the server configuration file ","
""
"'Basename ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // file name of the file requesting execution ","
"'Basename ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name']),"] // file NAME of the actually executed file ","
"'Basename ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // file name of the actually executed file ","
"'Basename (_ FILE _): [', (),"] // FILE name of the actually executed code ","
"";"
"'Dirname ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // Directory of the request execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name'])," // Directory of the actual execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // Directory of the actual execution file ","
"'Dirname (_ FILE _): [', (),"] // Directory of the actually executed code ","
"";"
"" Require_once "(" B/B. php ");

/A/B/php

 "'$ _ SERVER [" HTTP_HOST "]: [', ['http _ host'],"] // HOST of the current request: Domain name information ","
"'
''' $ _ SERVER ["PHP_SELF"]: [', ['php _ SELF'], "] // relative address of the request execution file ","
"'$ _ SERVER [" SCRIPT_NAME "]: [', ['script _ name']," // relative address of the actual execution file ","
"'$ _ SERVER [" SCRIPT_FILENAME "]: [', ['script _ FILENAME ']," // absolute path of the actual execution file. ","
"'_ FILE _: [',"] // absolute path of the actually executed code. ","
"'
''' $ _ SERVER ["REQUEST_URI"]: [', ['request _ URI'], "] // all the content after/and in a url REQUEST. ","
"'$ _ SERVER [" QUERY_STRING "]: [', ['query _ string'],"] // url request? . ","
"'
''' $ _ SERVER ["DOCUMENT_ROOT"]: [', ['document _ root'], "] // document root directory. Define "," in the server configuration file ","
""
"'Basename ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // file name of the file requesting execution ","
"'Basename ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name']),"] // file NAME of the actually executed file ","
"'Basename ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // file name of the actually executed file ","
"'Basename (_ FILE _): [', (),"] // FILE name of the actually executed code ","
"";"
"'Dirname ($ _ SERVER [" PHP_SELF "]): [', (['php _ SELF']),"] // Directory of the request execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_NAME "]): [', (['script _ name'])," // Directory of the actual execution file ","
"'Dirname ($ _ SERVER [" SCRIPT_FILENAME "]): [', (['script _ filename'])," // Directory of the actual execution file ","
"'Dirname (_ FILE _): [', (),"] // Directory of the actually executed code ","
"";"
";

Mongod: \ phpnow \ vhosts \ d.com. yii, which has Files/x. requeir_once/. php, and/. php and requeir_once/a/B. php...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.