Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alias, Redirect...not sure of the proper word. Help with httpd. 1

Status
Not open for further replies.

Graedon

IS-IT--Management
Sep 20, 2006
13
US
I have a local testing server running XAMPP. The system root path is based on a windows config.
My remote server is linux and so the system root path is different.

I have php files running on my different websites that reference include files based on that system root. It all works correctly on the remote server, but obviously, that same system path doesn't work locally.

Is there a way to tell apache to "translate" that system path to work with my local system path without having to change the includes back and forth depending on which server I'm running on?

That may be a bit hard to understand. Please let me know and I will be glad to elaborate a bit more.

Thanks!
 
If I understand your post correctly, you have a set of PHP files that you want to execute on both a linux and windows system and are running into path problems.

I would suggest placing everything under a common folder name that is the same on both and make all your paths relative to that common name.
 
Well, I do have them in a similar folder structure...but the root of the ht docs is different from one to the other. For instance, linux doesn't use the drive letter, whereas Windows does. Not much I can do about that.

I ended up finding the answer though. The php variable $_SERVER['DOCUMENT_ROOT']. Using it instead of the full ht docs root works perfectly on both machines.

Thanks!
 
Thank you for posting the solution. That was a unique problem, but one I could see someone else coming across. A star for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top