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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:53:25+00:00 2026-05-26T00:53:25+00:00

I am having trouble trying to get a file to be included into a

  • 0

I am having trouble trying to get a file to be included into a php script. This file is stored in the root folder, which is not the actual web root, but the root directory that I have access to via the shared hosting account.

I have created a folder in this directory that stores php session data, the .htaccess configuration regarding this would be the following line:

php_value session.save_path "/usr/home/accountname/sessions"

The web root would be stored in this directory:

/usr/home/accountname/public_html/domainname/

What I am trying to do is secure the scipt that holds database connection details, in a folder that would be something like this:

/usr/home/accountname/includes/

This is how i currently include the file:

require_once $_SERVER['DOCUMENT_ROOT'].'/includes/config.php';

I have tried this:

require_once $_SERVER['PATH'].'/usr/home/accountname/includes/config.php';

As $_SERVER['PATH'] points to /bin

This is not working as the page comes out blank, this would mean that the variables defined in config.php are not active as the page has not been included.

Could anyone provide some information regarding this matter, or point me in the direction of solving the problem. Also, any tutorials or other info regarding this would be greatly appreciated.

Thank you!

  • 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-26T00:53:26+00:00Added an answer on May 26, 2026 at 12:53 am

    If the script including config.php is stored under your Web root, you can write:

    require_once dirname(__FILE__) . '/../../includes/config.php';
    

    Have you already tried?

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

Sidebar

Related Questions

I'm having some trouble trying to get my script to send a file attachment
I'm having trouble trying to get a linebreak included in a Stringbuilder to appear
I am having trouble trying to get iterators for inner sub-containers. Basically imagine this
I am having trouble trying to get NAnt to compile my project, which consists
I'm having trouble trying to get my class working in my node.js file. When
I am having trouble trying to get a group of li tags to align
I'm brand new to C++ and am having trouble trying to get a function
I'm having terrible trouble trying to get a navigation controller up-and-running. Basically, I want
I am having serious trouble with trying to get all the forms on a
I am trying to get a nice paginator to work but I'm having trouble

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.