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 6141945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:19:12+00:00 2026-05-23T18:19:12+00:00

On my WAMP setup, I’m using $_server[‘document_root’] in a number of filepaths.. I had

  • 0

On my WAMP setup, I’m using $_server['document_root'] in a number of filepaths..
I had been using a static $ROOT variable, but thought it would be nice not to have to edit that constant when uploading the site.

Unfortunately, on my WAMP setup, $_server['document_root'] is being defined as 'C:/wamp/www/' and none of the links seem to be working under WAMP on Windows (though they were fine on MAMP on Mac when I initially made the change). It’s looking in file:///C:/wamp/www.

I had read an article that was espousing the virtues of document_root for security reasons and ease of use. Is it really recommended, though? It occurs to me that it could be something different depending on the installation.

I’m thinking of just defining the document_root variable, but now I’m wondering whether it’s reliable to use the variable at all.

  • 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-05-23T18:19:13+00:00Added an answer on May 23, 2026 at 6:19 pm

    I don’t have experience with WAMP, but do have experience with $_SERVER['DOCUMENT_ROOT'] and alternatives. I’ve found $_SERVER['DOCUMENT_ROOT'] to be the most reliable relative path to work from in an application.

    The Reserved Variables documentation has quite a few comments on $_SERVER['DOCUMENT_ROOT'] related to windows (most specifically to IIS though, not WAMP)

    http://www.php.net/manual/en/reserved.variables.php#45229

    It sounds to me like your DocumentRoot for your site is pointing to C:/wamp/www/ and not the subfolder for your domain within www/. You can learn about Apache’s DocumentRoot here.

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

Sidebar

Related Questions

I been developing a site offline on a WAMP setup and have been serializing
I have a WAMP (windows (7), apache, mysql, php) stack all setup and running.
I'm using WAMP as a server, and I have a need to execute svn,
I have wamp setup with quite a few websites setup as virtual hosts like
I have wamp installed and am using it as my testing ground. I can't
I'm trying to set up MongoDB with PHP and WAMP. I had WAMP 64
I have installed WAMP 2.1 on Windows 7 with PHP-5.3.4 and Apache-2.2.17 but instead
I have wamp setup on my windows box. Generally, when I bring a site
I am new to WAMP and I have just installed it today. The setup
So I have been doing some PHP and Python/Apache/MySQL (WAMP!) development for a while

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.