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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:53:42+00:00 2026-05-23T03:53:42+00:00

I store all of my scripts in the same place on the server and

  • 0

I store all of my scripts in the same place on the server and reference then using PHP include statements. But what if I want or need to change that directory? Do I really want to change every statement? Absolutely not.

One thing that I debated doing was to include a file named ‘scriptsdir.php’ that would be in the home directory for easy access. All this file would be responsible of doing is to define the constant ‘SCRIPTS_DIR’ as that directory. This suffices but if THAT file has to be moved or something happens to it, etc. I was wondering if I could define a constant that would be accessible without ever having to manually define it.

Is there a way to do this in php.ini or .htaccess or anything?

  • 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-23T03:53:43+00:00Added an answer on May 23, 2026 at 3:53 am

    Another option is to declare a variable $_SERVER["SCRIPTS_DIR"] via .htaccess using:

     SetEnv SCRIPTS_DIR /var/www/project123/includes/
    

    That would be available reliably to all scripts beneath the document_root and can often simplify relocations.

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

Sidebar

Related Questions

I have problem with return statment >.< I want to store all magazine names
SQL Server 2008 provides the ability to script data as Insert statements using the
Ok Soo I have 3 Sites. All need to store a cookie that each
Hi all I am using Zend framework for my PHP project. Basically I have
I'm building a PHP CMS, but having trouble with variables. I want to be
I using a new server (Rackspace, Ubuntu 10.04) trying to run a php file
I normally store all my configs in the registry. Even though I have started
We have a requirement in project to store all the revisions(Change History) for the
Is there any way to make Visual Studio 2008 Express store all the files
I have a properties file in java, in which I store all information of

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.