How to set $_SERVER['DOCUMENT_ROOT'] to the Project folder?

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

How to set $_SERVER['DOCUMENT_ROOT'] to the Project folder?

Postby blUserExplorer » Mon Feb 27, 2017 9:07 pm

Hi,

When using the Webuilder 2016 built-in server,

$_SERVER['DOCUMENT_ROOT'] is always pointing to the root directory of the hard drive (C:\).

So hrefs to code in subfolders of the project folders, are trying to point to subfolders of the drive root directory.


How can the $_SERVER['DOCUMENT_ROOT'] be re-interpreted as the WeBuilder Project folder?
blUserExplorer
 
Posts: 13
Joined: Sun Mar 13, 2016 2:56 am

Re: How to set $_SERVER['DOCUMENT_ROOT'] to the Project fold

Postby Aivars » Mon Feb 27, 2017 9:34 pm

The built-in webserver doesn't change document root for each project. If this limits you then you should probably install and use dedicated server (e.g. Apache + PHP) with customized virtualhosts.
We'll consider if having customized document roots for projects is possible.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: How to set $_SERVER['DOCUMENT_ROOT'] to the Project fold

Postby blUserExplorer » Mon Feb 27, 2017 9:48 pm

That's fine, Aivars. Our projects are fairly long. I don't mind having to set up a different root folder for each, then changing it when we switch to another project.

So, how would we set the root folder to the current project folder? Or to any folder, so that debugging would result in DOCUMENT_ROOT = <desired folder>?

Are you saying, that it isn't possible to customize the root folder, at all?

Sorry if I'm too hopeful, just want to be clear.


Aivars wrote:The built-in webserver doesn't change document root for each project. If this limits you then you should probably install and use dedicated server (e.g. Apache + PHP) with customized virtualhosts.
We'll consider if having customized document roots for projects is possible.
blUserExplorer
 
Posts: 13
Joined: Sun Mar 13, 2016 2:56 am

Re: How to set $_SERVER['DOCUMENT_ROOT'] to the Project fold

Postby Aivars » Fri Mar 24, 2017 6:24 pm

I personally use local Apache server for my bigger/longer projects and the built-in webserver for small/experimental/test stuff only. The reason why built-in webserver points to c:\ is due to fact that its path (and URI) is composed from the drive root and doesn't change depending on the project. This isn't good for projects that have a certain specific entry point, but it's great for quickly previewing stand-alone scripts from anywhere, whether they belong to the project or not.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 4 guests