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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:09:12+00:00 2026-05-15T00:09:12+00:00

I have 2 servers that are on completely separate OS’ and configurations. One properly

  • 0

I have 2 servers that are on completely separate OS’ and configurations. One properly accepts require_once '../file.php'; and the other doesn’t, because it’s relative to where the cron is loading I guess.

How can I fix the 2nd location so that it’s relative path is from the relative path of the file. I need this to work in 3 different environments (local, beta, and live) so I don’t want to write a bunch of code on this page, I’d prefer a configuration adjustment if possible.

  • 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-15T00:09:12+00:00Added an answer on May 15, 2026 at 12:09 am

    __FILE__ will specify the full file path of the current script.

    realpath() translates paths with relative components into absolute paths.

    This should work:

    require_once (realpath(dirname(__FILE__)."/../file.php"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have various servers that have many directories shared. It's easy enough to look
I have 6 servers that i need to deploy my ASP.NET web application to.
When I have two mysql servers that have different jobs (holding different databases) but
I have an application running on multiple IIS servers that need to parse a
I have a bunch of EC2 servers that are load balanced. Some of the
I have a defined number of servers that can locally process data in their
We have a ftp system setup to monitor/download from remote ftp servers that are
I currently have an asp.net website hosted on two web servers that sit behind
can anyone help. I have recently moved servers, its IIS7 rather that our previous
I have a script that checks responses from HTTP servers using the PEAR HTTP

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.