I have a question regarding paths and the include() statement in PHP.
I develop in a Windows environment and will be publishing to a Linux
server. I would like to do the following:
1. Setup my include references in such a way that I don't have to
change them all every time I have to publish to the production server
2. Setup above in such a way that won't involve php.ini (& LInux
equivalent), as I have access to edit this file locally, but won't be
able to do so in the production environment
My file structure is such:
wwwroot
subdir
global
inc
I tried Windows-styled virtual references such as "/" to refer to the
wwwroot, but that didn't work in the production evironment. I switched
to relative paths (eg include("global/inc/config.inc") or include
("../global/inc/config").
I guess what I'm looking for here is a best practice for how to set
the includes up for maximum portability across servers with different
file systems as well as different platforms. Can you, for instance,
incorporate a variable that defines the root path into the include
statement above? If so, where do you define this variable globally
without having to add to every file? (b/c you can't use an include
statement if you haven't gotten the includes to work) Is there an
equivalent of global.asa for the PHP world?
I'm just raising some issues with my experience thus far. I know
there's a solution and a best practice that I'm just missing to the
point--I would appreciate any wisdom that could be shared.