open_basedir does not seem to set the base path

328 views Asked by At

On my Synology (linux) server I have set-up three Apache2.4 / PHP web environment with the roots being:

/volume1/web
/volume1/webDevZone
/volume1/webTstZone

I would like to have a mechanism where I can call something like echo $_SERVER [DOCUMENT_ROOT] and get / regardless what environment I am running on. This way when I can call includes or require without needing to change things as I move my application from one environment to the other.

Unfortunately, _ DIR _ does not do the trick as it does not returns / (the desired result). Instead it returns the full path of a file. So if the file is nested a few levels, then _ DIR _ returns all levels.

I'm thinking that the solution would not be a PHP one, but rather an Apache one.

I was hoping that open_basedir do it, but it doesn't seem so.

Any idea?

Thanks

0

There are 0 answers