Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:41:09+00:00 2026-06-10T06:41:09+00:00

phpinfo() shows a variable named _SERVER[CONTEXT_PREFIX] . It is not documented at http://www.php.net/manual/en/reserved.variables.server.php .

  • 0

phpinfo() shows a variable named _SERVER["CONTEXT_PREFIX"]. It is not documented at http://www.php.net/manual/en/reserved.variables.server.php.
What exactly is it? Where can I find documentation on all of the $_SERVER[*] variables? There are a few more in that list that are not on the php.net webpage.

EDIT
I see from the comments that this is probably server-dependent. I am using the UniServer stack on windows, but since this is unreliable, I won’t depend in this key being present.

Is there a list of which keys are present 99% of the time (that is, in all likely setups)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:41:10+00:00Added an answer on June 10, 2026 at 6:41 am

    It looks like it’s new in Apache 2.3.13, according to source control for June 28th. There is also CONTEXT_DOCUMENT_ROOT which appears easier to understand.

    “Introduce new context_document_root and context_prefix which provide information about non-global URI-to-directory mappings (from e.g. mod_userdir or mod_alias) to scripts.” Source: http://marc.info/?l=apache-cvs&m=130928191414740

    It’s coming from Apache, and is related to when you can have different mappings between the request URI and different directories, such as when you use http://example.com/~username to access a website under “username”‘s web space, so the actual document root will vary.

    I presume where it will come in useful is if you specify multiple directory sources for one URI, such as:

    Userdir public_html /usr/web 
    

    then you’re never sure if the files are at “public_html” or “/usr/web” (as it tries one first, then the other) so the CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX help you find it.

    Can’t see any formal documentation on it yet as 2.3 appears to have been skipped in the docs (http://httpd.apache.org/docs/)


    Edit: The comments have answered your other part about what server variables can you rely on (impossible to say). If you find that the “CONTEXT” variables are meeting your needs, then you may need to write a functions that says “if they exist, use them, but if not, use another one”.

    A common example of this is when you try to (unreliably, I know) get the source protocol. You’ll check for the proxy added headers first (X_FORWARDED_PROTO) before you search for HTTPS = ‘on’. You may need to do similar if the environment variable just happens to be right on your server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried generating the complete set of timezones as specified in http://php.net/manual/en/timezones.php (except UTC)
Some pages are showing the phpinfo() output (in HTML so not php -i )
cURL does not appear in phpinfo() and fails inside of PHP scripts even after
I've assigned the memory limit of php to 999m so it appears in phpinfo
when i do phpinfo() in my localhost it shows Virtual Directory Support enabled but
I have installed php successfully on a Windows 7 machine but I can not
how properly can I hide .php extensions form my url : example: www.example.com/index.php to
Need some hint: I have installed PHP on Windows Server 2008. The phpinfo() can
I have tried everything.. GD will not enable! Essentially, I have extension_dir=C:\PHP\ext extension=php_gd2.dll I've
Even though my phpinfo() shows my DOM as enabled, when I try to call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.