Jump to content

Files Above Public_html


owatagal

Recommended Posts

Does it take any extra server resources to call on files that are above /public_html/? I've moved some password and permissions-based navigation menus there, and I'd like to move all my PHP scripts up--it's not so much that they're sensitive info as I want my scripts in once place.

 

The files call them in as includes anyway, and I generally use a full path -- /home/username/public_html/folder/include.php -- so this wouldn't change anything in terms of the numbers of includes I use or how the scripts actually run. But if for some reason the server can include files faster or with less resources when they're in /public_html/, I can leave the bulk of my scripts there and play with .htaccess or something to block off a folder. I'd just prefer keeping it all together to spreading it across two sections of the site.

Link to comment
Share on other sites

I would think that the increase (if any) wouldn't be all that noticable...unless you're running some highly intensive processes. I have all of my sql password files located in a directory off of public_html and haven't had any problems (that I know of anyway).

 

If I'm incorrect, I'm sure someone will let us know.

Link to comment
Share on other sites

owatagal, there is no difference at all, you can place the PHP files that to be included anywhere in the filesystem, as long as the webserver can read them :)

My understanding is that *data* may be located outside of the public_html tree, but scripts that a user actually wants to execute via http have to be in the public_html tree. Otherwise, the web server can't actually read them -- or am I off base?

 

For example, .htpasswd files and berkeley DB files for MovableType are stored outside of the public_html path, but the actual CGI files (same for PHP, I assume) need to be web-readable and therefore somewhere inside of public_html. So, some of the files that

owatagal wants to include should be fine residing just about anywhere, but not the scripts.

 

Right?

Link to comment
Share on other sites

The PHP scripts are running fine in the the private folder, so it must be a difference between PHP and whatever runs in CGI (Perl? who knows. I never did CGI stuff). I'm able to do all my user authentication, data checks, database queries, etc, and keep the files for them out of the /public_html/ folder. Which I like. A lot.

Link to comment
Share on other sites

Exactly, I probably should have explained that better.

 

PHP files that you want your visitors to access need (obviously) to be under the public_html directory. If some files are not supposed to be accessed by your visitors, then you can move them into a directory outsite public_html, which can be considered indeed a good security measure, as owatagal is saying :thumbup1:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...