[SLE] "/index.php" works, "/" doesn't
I've got a SuSE 10.1 webserver exhibiting an odd behaviour - if I hit the site with "/index.php" the page loads, if I hit the site with just "/" then it prompts me to download the PHP script. So it isn't DirectoryIndex not detecting the index.php file, it is that the PHP script in that instance isn't processed by PHP. Scratches head.... If I just hit "/" I get - You have chosen to open which is a: PHP script - from FireFox. I have another SuSE 10.1 webserver which serves up an almost identical site, and it works fine. I've gone back and forth over the configs and can't find any real differences (and this is kind of a pretty standard sort of thing). Anyone seen anything like this before, and maybe have some pointers where to look?
Adam Williams wrote:
Anyone seen anything like this before, and maybe have some pointers where to look?
Your PHP script is - somehow - being served with the wrong MIME-type. Also implies it isn't being put through the PHP-interpreter. /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Anyone seen anything like this before, and maybe have some pointers where to look Your PHP script is - somehow - being served with the wrong MIME-type. Also implies it isn't being put through the PHP-interpreter.
Make sense, but why is the proper MIME type detected when the file is requested explicitly, but not when the file is selected by DirectoryIndex? /etc/apache2/mime.types contains - application/x-httpd-php phtml pht php php3 php4 php5 In /etc/apache2/httpd.conf - DirectoryIndex index.php index.html index.html.var
Adam Williams wrote:
Anyone seen anything like this before, and maybe have some pointers where to look Your PHP script is - somehow - being served with the wrong MIME-type. Also implies it isn't being put through the PHP-interpreter.
Make sense, but why is the proper MIME type detected when the file is requested explicitly, but not when the file is selected by DirectoryIndex?
The latter means auto-negotation, though I can't see why that would affect the mime-type ...
/etc/apache2/mime.types contains - application/x-httpd-php phtml pht php php3 php4 php5
Do you also have something along the lines of: AddType application/x-httpd-php php ....... /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Anyone seen anything like this before, and maybe have some pointers where to look Your PHP script is - somehow - being served with the wrong MIME-type. Also implies it isn't being put through the PHP-interpreter. Make sense, but why is the proper MIME type detected when the file is requested explicitly, but not when the file is selected by DirectoryIndex? The latter means auto-negotation, though I can't see why that would affect the mime-type ... /etc/apache2/mime.types contains - application/x-httpd-php phtml pht php php3 php4 php5 Do you also have something along the lines of: AddType application/x-httpd-php php .......
Nope, and adding it to httpd.conf or mod_mime.conf doesn't seem to have any effect. Also of note, my other server which works fine, doesn't seem to have this diretive anywhere. --- other server that works --- tor:/etc/apache2 # grep -d recurse -i addtype * extra/httpd-ssl.conf:AddType application/x-x509-ca-cert .crt extra/httpd-ssl.conf:AddType application/x-pkcs7-crl .crl mod_mime-defaults.conf:# AddType allows you to add to or override the MIME configuration mod_mime-defaults.conf:#AddType application/x-tar .tgz mod_mime-defaults.conf:AddType application/x-compress .Z mod_mime-defaults.conf:AddType application/x-gzip .gz .tgz mod_mime-defaults.conf:Addtype image/x-icon .ico mod_mime-defaults.conf:#AddType text/html .shtml ssl-global.conf: AddType application/x-x509-ca-cert .crt ssl-global.conf: AddType application/x-pkcs7-crl .crl
Adam Williams wrote:
Do you also have something along the lines of: AddType application/x-httpd-php php .......
Nope, and adding it to httpd.conf or mod_mime.conf doesn't seem to have any effect. Also of note, my other server which works fine, doesn't seem to have this diretive anywhere.
Yeah, I did note that. They're obviously not quite the same setup, but close - what's the main difference? (apart from php not working ...) Did you check if you've got the PHP module loaded? /Per Jessen, Zürich -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
participants (2)
-
Adam Williams
-
Per Jessen