Apache Server configuration support - Re: use virtual hosts to develop locally but upload throws error

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > January 2007 > Re: use virtual hosts to develop locally but upload throws error





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: use virtual hosts to develop locally but upload throws error
Jerry Stuckle

2007-01-20, 7:26 pm

Toby Inkster wrote:
> Jerry Stuckle wrote:
>
>
> Makes it tricky to move your php around *within* your document root
> though. I try to make my code run equally well rooted in "/somedir/" as it
> does in "/".
>


Sure. But I almost never do that. And if I do, I can quickly do a
search/replace for the file path. On a 3K+ file site it takes less than
a minute to replace all of the references.

> Putting everything in an 'includes' directory and then specifying the
> location of the files in include_path allows you to easily move the
> includes anywhere (including outside the document root altogether, which
> is often desirable from a security POV) without making any changes to your
> scripts at all.
>


Sure - if you're on Apache, if you have .htaccess, if your host allows
PHP changes to .htaccess...

And files can be outside of the document root with this means, also - i.e.

$_SERVER['DOCUMENT_ROOT'] . '/../passwords.txt'

would be the file 'passwords.txt' one level below the document root.

And again - search/replace changes the scripts just fine. Use the right
tools and you don't need gimmicks.

>
> Better to use "httpd.conf" or "php.ini" for such settings, but not
> everyone is able to. I tend to use ".htaccess" for testing and then
> migrate to "httpd.conf" once I'm sure.
>


Again - what if you're on an IIS system? No .htaccess. What if your
hosting company has restricted you so that php cannot load values from
..htaccess? I've found several who do.

>
> As does "include_path" -- you just need to set it in php.ini.
>


Which is impossible on a shared host. Not everyone has access to or
needs a dedicated server or a vps.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com