[Klug-general] Apache2 filename/dir mish-mash [solved]

James Morris jwm.art.net at gmail.com
Thu Sep 9 09:07:35 UTC 2010


On 8 September 2010 23:27, James Morris <jwm.art.net at gmail.com> wrote:
> On 8 September 2010 23:23, Karl Buckland <buckland.karl at googlemail.com> wrote:
>> Do you have a .htaccess file in your document root? Allowoverride would
>> allow that file to cause the sort of disruption you describe.
>
> At the moment, no, none at all.
>
> James.
>
I noticed a difference in the output of <?php print_r($_SERVER); ?>
with valid and invalid URLS. Invalid (IMHO) URLs have these two
additional variables (which provide a clue):
   [PATH_INFO] => /poop/
   [PATH_TRANSLATED] => /home/james/Projects/jwm-art.net/www/poop/

Which lead me to find this on php.net:
"Note:  As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly
under the Apache 2 SAPI in contrast to the situation in Apache 1,
where it's set to the same value as the SCRIPT_FILENAME server
variable when it's not populated by Apache. This change was made to
comply with the CGI specification that PATH_TRANSLATED should only
exist if PATH_INFO is defined.   Apache 2 users may use AcceptPathInfo
= On inside httpd.conf to define PATH_INFO."

So I added AcceptPathInfo Off /etc/apache2/httpd.conf and problem
solved. Seems a bit of a nuisance though and strange default
behaviour, but maybe this has helped someone else too.

Cheers,
James.


-- 
_
: http://jwm-art.net/
-audio/image/text/code



More information about the Kent mailing list