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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:22:30+00:00 2026-05-12T05:22:30+00:00

Currently on my site I’m using statements like: include ‘head.php’; include ‘../head.php’; include ‘../../head.php’;

  • 0

Currently on my site I’m using statements like:

include 'head.php';
include '../head.php';
include '../../head.php';

depending on how many nested folders deep I am. I’m sure there is a better way to do this.

I’m convinced .htaccess is the solution, but I’m not sure how to go about implementing it. If I insert:

php_value include_path "public/html/root"

… I lose the rest of my paths (/usr/lib/php, etc). I naively tried:

php_value include_path $include_path . "(path)"

but of course this didn’t work. How could I prepend or append a single path to this list with .htaccess?

  • 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-12T05:22:31+00:00Added an answer on May 12, 2026 at 5:22 am

    If you can’t edit the php.ini file itself, you could add

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

    before your include statements.

    However if you find yourself having include or require troubles, it is probably a code smell. The best solution would be a good object-oriented design with a good __autoload function.

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

Sidebar

Related Questions

I currently have a site where different users can login, and depending on their
I am currently building a web site and I just implemented SqlCacheDependency using LinqToSQL
I'm currently adding verbose tooltips to our site, and I'd like (without having to
I have a site that I am currently working on in ASP.NET 2.0 using
I am currently creating an e-commerce site using C# ASP.NET MVC and have just
My site currently handles URL's like this... /?p=home /?p=profile&userid=1 /?p=users.online /?p=users.online&page=23 /?p=mail.inbox /?p=mail.inbox&page=12 ...
We are using gravtars for a site currently being developed in rails 2.3.4 and
I am working on Flash,Php site.Currently the Flash Developer calles my page called createJPG.php
I am currently developing a site and have a need for a javascript-based carousel/slider
Currently I am developing a site with about seven partial classes, a few icons,

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.