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

  • Home
  • SEARCH
  • 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 7870297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:34:39+00:00 2026-06-03T01:34:39+00:00

I have php scripts that were working ok since Ocober last year, last I

  • 0

I have php scripts that were working ok since Ocober last year, last I remember was 2 months ago and today while executing them I have problems with _SERVER[‘DOCUMENT_ROOT’] variable.

If I look at the _SERVER array, it is not set. While if I execute in a script:

phpinfo();

Then the variable is there and set. But calling it:

$_SERVER['DOCUMENT_ROOT']

Returns null

What is the reason for this? How can I use it again in my scripts? I figure the cause was a php or apache update, but both have been updated few times in the last 2 months.

Also, I don’t see DOCUMENT_ROOT in php.ini file. I do see doc_root, which is different.

My php:
PHP Version 5.3.5-1ubuntu7.7
apache:
PHP Version 5.3.5-1ubuntu7.7

  • 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-03T01:34:41+00:00Added an answer on June 3, 2026 at 1:34 am

    DOCUMENT_ROOT is an environment variable normally set by the (apache) webserver before calling you script via CGI. If your webserver has a bug or is misconfigured, it can happen that this environment variable is not set any longer.

    You can try to debug and/or hotfix that with mod-rewrite, mod-cgi, mod-setenv or similar. If that is all above your head, please contact your server administrator and discuss the issue because it can have many reasons.

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

Sidebar

Related Questions

I have a script that generates images from text using PHP. It's working fine
I have php scripts that do things like register, login, upload. I would like
I have a series of PHP scripts that I want to run in a
I have a collection of PHP scripts that are extremely CPU intensive, juggling millions
I have a directory of PHP scripts ( mainly utilities), that is located on
I've launched an application last week and have noticed since that in Chrome only
I have a tested and working php script that pulls from a db and
I have php script that creates a temporary watermark image for users that are
I have a PHP script that executes a .bat file using system(cmd /c C:\dir\file.bat);
I have a php script that backup my table in .sql format and I

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.