[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Stupid apache bug in search page fixed!



I think I solved the problem with apache spitting out PHP source code
instead of interpreting it, it's a rather nasty little thing.

OK, We got multviews on so we can do language negotiation. We have a
bunch of files like
index.php
index.en.php -> index.php
index.pl.php -> index.php

Fire up netscape and it works fine, try it in IE, ok too.

So then update your php code, you might do somethnig like
mv index.php index.php.old
cp <somewhere> index.php

Works ok in netscape, downloads PHP code in IE from certain countries.
IE may even ask you where you would like to save it.

What the hell is going on?

The clue for me was chucking a whole lot of debug code into my php
script index.php, it didn't appear in the IE screen. A few chmod 600
around the place and I found my culprit, index.php.old

For some reason, it was downloading index.php.old !! Now the .old suffix is
not a known one, so it just makes it an unkown mime type and IE tries to
save it to disk.

The important thing is to ensure you have only stuff you want when you
do ls index*

This problem only occurs with certain charactersets. EG, mine is
en-au, having no languiage set or making it en made it work ok.


 - Craig
-- 
Craig Small VK2XLZ  GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.eye-net.com.au/        <csmall@eye-net.com.au>
MIEEE <csmall@ieee.org>                 Debian developer <csmall@debian.org>



Reply to: