How can I find an application's base url?

后端 未结 11 1399
南方客
南方客 2020-12-16 01:35

I\'d like to find the base url of my application, so I can automatically reference other files in my application tree...

So given a file config.php in the base of my

11条回答
  •  抹茶落季
    2020-12-16 02:00

    I've never found a way to make it so.

    I always end up setting a config variable with the server path to one level above web root. Then it's:

    • $configVar . 'public/whatever/' for stuff inside root,
    • but you can also include from outside with $configVar . 'phpInc/db.inc.php/' etc.

提交回复
热议问题