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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:01:11+00:00 2026-05-16T11:01:11+00:00

I am developing a web application. contents are: root dir (/var/www/) config.php index.php details.php

  • 0

I am developing a web application. contents are:

  • root dir (/var/www/)

config.php

index.php

details.php

  • admin dir (/var/www/admin)

admin.php

I have included config.php file into index.php, details.php in root directory using require_once(‘config.php’) as this file contains database passwords, styles, images directory paths..

how can i include that config files in my admin/admin.php file so that one config file can be used in anywhere(even in subdirectories) of my web application. Will it make any difference for the value of define('APP_BASE_PATH', dirname(__FILE__)); when same config file is used by all files in the web application.

if i am wrong somewhere then please get me right.

  • 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-16T11:01:11+00:00Added an answer on May 16, 2026 at 11:01 am

    Update after clarification in comments: You are looking for a way to include a central configuration file from anywhere in your project’s folder structure.

    @Col. Shrapnel shows one way, DOCUMENT_ROOT. It’s the only way to use an “absolute” path from a nested folder structure. It has the limitation I describe above, but it’s fine otherwise.

    If you want maximum portability (i.e. the possibility to run the app with e.g. www.example.com/myapp/version_1 as its root directory), you would have to use relative references from within your folder structure to “climb down” to the config file, e.g. ../../config.php that will work reliably too, although be a bit cumbersome e.g. if you move a script to a different folder and you have to update the relative path.

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

Sidebar

Ask A Question

Stats

  • Questions 518k
  • Answers 518k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you are trying to use aggregate initializer to initialize… May 16, 2026 at 8:19 pm
  • Editorial Team
    Editorial Team added an answer I'm not sure a generic CSV reader would be this… May 16, 2026 at 8:19 pm
  • Editorial Team
    Editorial Team added an answer Are you sure "all-delete-orphan" is what you want? From Section… May 16, 2026 at 8:19 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm developing one web application, using PHP eclipse IDE. For an instance i want
I am developing a web application and I am wondering if someone has a
When developing a .Net web application, if a run time error is generated, it
I am developing a small, internal-use only web application. Given its simple nature and
I'm currently developing a web application for a particular niche. The point is that
I'm developing a web application for sending SMS to mobile from website like 160by2
We are currently developing Sliverlight 4.0 based web application using PRISM 4.0 for Sliverlight
I'm developing a Grails (Version 1.3.3) Web-Application using the Grails Spring-Security Plugin, Spring-Security-Core-1.0.1 (which,
Basically my intention is to create web application. I have to use js, ajax,
M developing an application which starts with a login page. After loggin the user

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.