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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:51:50+00:00 2026-05-25T05:51:50+00:00

Ok, to start with – I am addicted to using a root relative link

  • 0

Ok, to start with – I am addicted to using a root relative link structure for everything. Include in php always makes that difficult for me, but I happened upon a line of code that lets me include root-relatively.

It’s really simple:

set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );

That’s from a comment in the php manual

I have a pretty simple php site, but with many different subdirectories, and this makes it easy to use. Also – the company may be switching servers soon, and I am thinking this may ease the transition for many sites.

So is there a security risk here? I don’t dynamically include files or remotely include them. Am I taking a performance hit including this at the top of every php file? or is it negligible?

  • 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-25T05:51:50+00:00Added an answer on May 25, 2026 at 5:51 am

    There is no security risk as long as you control what you put in the include_path.

    There is, however, a performance hit if you have too many paths in your include_path (as PHP will have to try each path before finding the file).

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

Sidebar

Related Questions

To start: <test style=font:2px;color:#FFFFFF bgcolor=#CCCCCC TOPMARGIN=5>style</test> Using XSLT/XPATH, I copy everything over from my
I start to write a client - server application using .net (C#) for both
I start Firefox (Linux) via command line using a cron-job. When there is no
Process.Start(IExplore.exe); Does this always work, on every machine ? If not, how to do
Start a new web application using NetBeans 7 on GlassFish 3.1 In index.xhtml body
To start off, I'm using Asp.Net MVC 4, and I've modified my solution to
To start off, I'm not that great with database strategies, so I don't know
We start to use LDAP and I wonder why LDAP is not that popular?
Start with an array of integers so that the sum of the values is
To start I would like to mention that I tried Googling this to no

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.