In my live site I have php include() and require() that have full path such as: /www/mysite.com/webapps/mmh/head.php or /www/mysite.com/webapps/ROOT/zip/BoundaryWizard.php

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/mysite.com/webapps/mmh/ 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 ...

Comments

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 stackoverflow.com community.
It is licensed under cc-wiki