In my live site I have php include() and require() that have full path such as: /www/ or /www/

Now, I want to do some local development on my windows machine (Xampp), so obviously none of those path work.

Is there a way to tweak the apache or php settings to dynamically translate say /www/ to c:\xamp\mysite\some_other_arbitrary_folder ?

I assume the best way would be to have used relative paths is the first place, but this is legacy code, could take a while to fix ...


Not an answer, but in the future consider defining a ROOT_PATH constant to avoid these kinds of issues.

Written by Mike B

Accepted Answer

You should define() your application path and then use find and replace in a text editor, most editors have that feature.

Written by user191363
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the community.
It is licensed under cc-wiki