NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
setting up dirs not under docroot


Joined: 18 Jan 2007
Posts: 3
Reply with quote
How do I set up a directory that is not under doc root? I want to have a siteroot up one level from doc root, as required for security by one of the projects I use for custom templates and files. The structure is this:

siteroot/
siteroot/files
siteroot/htdocs

Do I set up siteroot/htdocs as the docroot, and then use the mapping tab to set up mapping another directory for the files directory?

_________________
JM
View user's profileFind all posts by JoeMurraySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Although this is explained in the manual and discussed multiple times in this forum, let me try to help you:

THERE ARE TWO WAYS:
1) YOU WILL SEE ALL THE PROJECT FILES IN THE WORKSPACE WINDOW
Project root directory should be pointing to the most upper directory containing all your files for the project.
URL and remote root should be left EMPTY
An additional (2nd) mapping entry should be added with following values:
Local directory -> full path to htdocs
URL -> http representation of htdocs
Remote dir -> htdocs as it's seen be the web server (same as local directory in case if web is local)

To get an idea how mapping works, let me show you an example. Suppose you have index.php in your web root (htdocs).
In this case {mapping LOCALDIRECTORY}\index.php, {mapping URL}/index.php, and finally {mapping REMOTEDIRECTORY}/index.php should all be pointing to index.php with exactly the same content. In other words it should be physically the same file or its copies (in case of remote debugging).

2) YOU WILL SEE ONLY HTDOCS FILES IN THE WORKSPACE WINDOW
Project root directory should be pointing to htdocs directory
URL should be web site root URL
Remote root should be htdocs directory as web server sees it (same as project root in case if web server is local)
Extra mapping entry for the topmost directory should be added. It will contain only Local and Remote directories (no URLs because they are out of the web tree).
You may want to add all out-of-htdocs directories to the Code Insight Includes list. In this case all libraries with their classes/functions/etc will be accessible in the Code Explorer and will be used in Code Completion.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Jul 2009
Posts: 2
Reply with quote
>> discussed multiple times in this forum
A sticky might be nice Smile

I can't seem to make this work. I'm running PHPED on a windows box. I use the SRV local web server for development. I have a remote site for the live system.

As many others, my remote site has an htdocs and a private folder at the top level. Users of the web site can only access htdocs.

My local disk has the same setup - a folder called web that contains htdocs and private.

Since 'private' contains essential parts of the website, I'd like to see it in the IDE.

So I set the Root directory to \web, but then SRV makes the root url localhost:8080/htdocs - which messes up all my links
Or I set the Root directory to \web\htdocs, then SRV sets the root url localhost:8080/ and my links work, but I can't see the private files in the IDE.

Please help!

_________________
WA
View user's profileFind all posts by walter704Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
SRV is a simple web server that treats project root as a web server root. If you have anything else, please switch to Apache or IIS.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Jul 2009
Posts: 2
Reply with quote
YAQAM (Yet another question about mapping). Sorry if it's just me, but I couldn't get the following to work:
I have two source code trees. One is a framework, common to many sites. The other is the site-specific code. On my fileserver, they look like this:

f:\source\website_a\htdocs [website code, public access]
f:\source\website_a\include\ [website specific include files]
f:\files\common\framework_1\ [framework code]

On the web server, they look like this:
/var/www/htdocs/ [website code, public access]
/var/www/private/include [website specific include files]
/var/www/private/framework [framework code]

How do I map this please? (And of course, it would be nice if auto-complete continued to work for the framework files).

If it helps, I can use 2 different 'private' folders (private_a/include and private_b/framework) on the web server. Likewise, on the file server, I can use any path and filenames I like as long as the htdocs and include folders are somehow under the same tree. I can't move the framework files under the website_a tree without violating our source repository, and I can't move the website files under the framework tree.

Thanks, W.

_________________
WA
View user's profileFind all posts by walter704Send private message
setting up dirs not under docroot
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic