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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:59:45+00:00 2026-05-24T15:59:45+00:00

I was wondering how can I make an path file in php? For example

  • 0

I was wondering how can I make an path file in php?
For example I would like to have a pointer file in the root folder that points to the folder where the php script are held.

I tried something like this, but it does not work.

path.php (is in the root file eg. htdocs/project1/week5)

$path = "/project1/week5/php";

set_include_path(get_include_path() . PATH_SEPARATOR . $path);

alert.php (is in the root file eg. htdocs/project1/week5)

include("path.php");
include("AlertFormAction.php");

AlertFormAction.php (is in htdocs/project1/week5/php)

What am I doing wrong? Could somebody be so kind and show me how it is supposed to be done? 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-24T15:59:46+00:00Added an answer on May 24, 2026 at 3:59 pm

    Your $path variable contains an absolute path that in most likelihood, does not exist.

    Paths in PHP are local (to the server) filesystem paths. At a guess, I’d say you want to try

    $path = '/htdocs/project1/week5/php';
    

    As the include path “php” seems to be relative to your path.php file, you may find this more flexible

    set_include_path(implode(PATH_SEPARATOR, array(
        __DIR__ . '/php',
        get_include_path()
    )));
    

    If using PHP 5.2 or lower, replace __DIR__ with dirname(__FILE__)

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

Sidebar

Related Questions

I'm wondering how I can make this code safer, I'm using it as login.php:
i was wondering how i can make my app display that notification number next
I'm wondering if people can suggest the best tutorial that will walk me through
I'm wondering if anyone can recommend a good C++ tree implementation, hopefully one that
I am wondering how I can break up my index.php homepage to multiple php
I was just wondering when you have for example: var dir = new DirectoryInfo(@C:\Temp);
I am just wondering if I can make several button templates in WPF then
I have a very limited jQuery experience and I was wondering if you can
I was wondering how can I make python order my collection of tuples so
I am wondering when I get my object back(Lets say File) and I make

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.