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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:08:56+00:00 2026-06-12T17:08:56+00:00

; Windows: \path1;\path2 include_path = .;C:\xampp\php\PEAR;C:\xampp\php\Zend;C:\xampp\htdocs\rpg_historian; Above you will find the address to my

  • 0
; Windows: "\path1;\path2"
include_path = “.;C:\xampp\php\PEAR;C:\xampp\php\Zend;C:\xampp\htdocs\rpg_historian;”

Above you will find the address to my include path in php.ini on my xampp server. I want to be able to include files from a folder called “includes” that is nested in my project rpg_historian. In PHP when I use –

<?php include('includes/header.php'); ?>

The page works and loads correctly. However, if I click on a link that sends me INSIDE of includes/ I end up in a position where the page will state –

> Object not found!
> 
> The requested URL was not found on this server. The link on the
> referring page seems to be wrong or outdated. Please inform the author
> of that page about the error.
> 
> If you think this is a server error, please contact the webmaster.
> 
> Error 404
> 
> localhost 10/06/12 09:46:58 Apache/2.2.21 (Win32) mod_ssl/2.2.21
> OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1

And my URL becomes http://localhost/rpg_historian/includes/index.php which is NOT where index.php is located. index.php is located in the root of rpg_historian. How do I go about setting up a system where I can easily set includes? I have tried the instructions located –
http://www.geeksengine.com/article/php-include-path.html

But for what ever reason even after setting the include path; It still doesn’t want to work correctly. Can someone explain to me how to set up a proper PHP include system that allows me to easily access files from folders? My understanding is that PHP is intelligent enough to cascade through folders to “find things” if set up properly.

  • 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-12T17:08:58+00:00Added an answer on June 12, 2026 at 5:08 pm

    The include path can either be absolute, i.e.:

    include('C:/xampp/htdocs/rpg_historian/includes/header.php');
    

    Or relative (like you have at the moment). If it’s relative, then it’s relative to the file that’s including it.

    Now, the usual solutions are either to include relative to the document root:

    include($_SERVER['DOCUMENT_ROOT'] . '/rpg_historian/includes/header.php');
    

    Or using some kind of pattern (like the front controller) to guarantee that the includes are processed in a consistent manner, then you can overcome the include_path directive by either prefixing a dot to the path (like include('./includes/header.php')) or by using a magic constant like __DIR__:

    include(__DIR__ '/includes/header.php');
    

    Now, all of this is about includes, but your problem seems to be about generating links (otherwise you would never go inside the include directory just by following an HTML hyperlink). In order to avoid this, make sure your HTML links point to the right place and not to the local (include) directory.

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

Sidebar

Related Questions

I have an include statement in a PHP script running on xampp on Windows.
I'm using Netbeans 7.0.1 in a PHP project. I've installed XAMPP 1.7 in Windows
We have an issue using the PEAR libraries on Windows from PHP . Pear
How do I find the local path on Windows in a command prompt?
Warning: include(/2008/2009/assets/inc/base/error.inc.php) [function.include]: failed to open stream: No such file or directory in C:\Program
I was reading here about problems in PHP when using include() or required() with
I am trying to setup the Zend Framework on a windows machine and I
How to add a library include path for NetBeans and gcc on Windows? Using:
I'm experiencing some weirdness trying to setup PEAR on my development machine (Windows XP).
I need Qt Creator to store some global include paths that will apply to

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.