DOC Root setting in config.php

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

DOC Root setting in config.php

Postby tvjames » Thu Nov 12, 2009 1:08 am

Hi everyone

Would it not be a feasible option to use $_SERVER['DOCUMENT_ROOT'] in the config.php file to set the DOC_ROOT variable which we normally use in ALL our projects?

Won’t it fetch the document root path for us?

If so we can be 100% sure that we always get the right document root.

If this is found to be a feasible option, would really appreciate if this can be followed MANDATORILY by all programmers.

Silvester/Jay please do ponder on this.

Looking forward to your comments.
tvjames
 

Re: DOC Root setting in config.php

Postby silvester » Thu Nov 12, 2009 1:44 am

$_SERVER['DOCUMENT_ROOT'] can be given to set the DOC_ROOT variable. Most of the open sources are following this pattern.

But in the local server we are building the project inside the respective sites folder. So we need to specify the rest of the folder path too.

ex: techwyse is a project inside wyseguyz folder so if we take $_SERVER['DOCUMENT_ROOT'] then we will be getting only /var/www/. Actually its path should be /var/www/wyseguyz/techwyse/.

The config file should be created by Tl's only so that no confusions arise.
silvester
 
Posts: 89
Joined: Mon Nov 10, 2008 12:59 am


Return to Programming

Who is online

Users browsing this forum: No registered users and 6 guests