Jump to content
Sign in to follow this  
owatagal

Files Above Public_html

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.

Share this post


Link to post
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.

Share this post


Link to post
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 :)

 

Moving for organization.

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×