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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:23:35+00:00 2026-06-02T19:23:35+00:00

I currently working on a PHP project. I copy the project file to my

  • 0

I currently working on a PHP project. I copy the project file to my local box. It runs fine except one thing.

Here is the folder hierarchy:

root/index.php
root/event/admin/list.php 
root/event/admin/functions.php

In the index.php, there is a line:

<?php include ("event/admin/list.php"); ?>

which should include the list.php

However in the list.php, there is a line:

<?php include_once "event/admin/functions.php";?>

Since the list.php is not in the root directory, event/admin/functions.php did not get call and my local index.php fail to load this part.
But the production is working fine.

Does anyone know what happened? Is that a way to setup include/include_once always use ROOT directory without using something like $_SERVER[“DOCUMENT_ROOT”]? Thanks a lot.

  • 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-02T19:23:36+00:00Added an answer on June 2, 2026 at 7:23 pm

    It is a good idea to use $_SERVER[‘DOCUMENT_ROOT’], in my opinion. You can do so like this:

    include_once($_SERVER['DOCUMENT_ROOT'] . "/path/to/file.php");
    

    However, try replacing he code in list.php with this:

    <?php include_once "../../event/admin/functions.php";?>
    

    This is a known issue relating to relative paths. Thus, DOCUMENT_ROOT is preferable. Alternatively, you can edit include_path.

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

Sidebar

Related Questions

In the project my team is currently working on, we're modifying a commercial PHP
We currently have a working php mail script, this works fine and as we
I am currently working on a PHP project which includes extensive database usage. The
I am currently working on a php project where I need to display a
I am currently working on a php project with the user of ajax. I
I am currently working on a php/javascript project which retrieves information from a database
I am currently working on a php/html/javascript project. I have a form where when
Hi I'm currently working on some php - zend framework project on my osx
Here's my situation: I'm working on a PHP project that uses a few functions
In a project I'm currently working for, we're considering putting system() into php.ini's disable_functions

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.