I need to define a few directory paths for an application. The folder setting The config.php is in the config folder which is placed outside the root directory (best practice, read somewhere). The application is placed in the root directory (myCms, in this case). Right now I am on a local server (xampp). The config.php has some configuration and few credentials as required by the program to function. As said, I need to define a few directories (images, template, system so on and so forth) in the config.php file. I previously defined them as define('DIRIMAGES','C:/xampp/htdocs/myCms/images/', false);I was planning to use the realpath() function to get the job done and tried this define('DIRIMAGES', str_replace('\\', '/',realpath(dirname(__FILE__))).'/images/', false);Later I included the config.php in the index.php (index.php in myCms folder) and echoed to check the path of the directory and it shows C:/xampp/htdocs/config/system/Where as I was looking for: C:/xampp/htdocs/myCms/system/Can you suggest or help? (责任编辑:) |