Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 148879 - *.php.*.jar files are interpreted as PHP files
Summary: *.php.*.jar files are interpreted as PHP files
Status: CLOSED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Website (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: phoenix.ui CLA
QA Contact: Yossi Luson CLA
URL:
Whiteboard:
Keywords:
: 149492 (view as bug list)
Depends on:
Blocks: 148226
  Show dependency tree
 
Reported: 2006-06-27 15:22 EDT by Michael Spector CLA
Modified: 2012-07-24 13:23 EDT (History)
4 users (show)

See Also:


Attachments
Screenshot of Open File dialog on download.eclipse.org (13.35 KB, image/png)
2006-10-10 12:31 EDT, Eclipse Webmaster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Spector CLA 2006-06-27 15:22:39 EDT
Some Jar files cannot be retrieved from the Eclipse.org site, for example:

http://download.eclipse.org/tools/php/updates/plugins/org.eclipse.php.core_0.1.4.jar
http://download.eclipse.org/tools/php/updates/plugins/org.eclipse.php.ui_0.1.4.jar
etc...

I think string ".php" is interpreted as file extension, and Apache tries to execute this Jar file
using PHP. I think it's because some extension, which allows appending locale suffixes to the filenames is installed,
which interprets ".ui_0.1.4.jar" as a locale name. 

+++ This bug was initially created as a clone of Bug #148226 +++
Comment 1 Eclipse Webmaster CLA 2006-06-27 15:25:31 EDT
It does indeed appear that apache is attempting to parse the file with php.  Any suggestions?

-M.
Comment 2 Michael Spector CLA 2006-06-28 00:56:41 EDT
(In reply to comment #1)
> It does indeed appear that apache is attempting to parse the file with php. 
> Any suggestions?
> 

Unfortunately, I'm not able to see Apache's configuration file due to lack of permissions. I guess Jar extension isn't registered, and if there's extension that is registered and others aren't apache uses one that is registered regardless of the order apparently because of the language negotiation which uses files like index.html.de.
Comment 3 Eclipse Webmaster CLA 2006-07-05 14:43:28 EDT
We have a possible fix for this, but because it requires modifying our Apache configs, we need time to test this thoroughly.

D.
Comment 4 Michael Spector CLA 2006-07-11 07:13:14 EDT
*** Bug 149492 has been marked as a duplicate of this bug. ***
Comment 5 John Cunningham CLA 2006-07-20 19:11:36 EDT
Apparently, this is potentially a more widespread problem - we just encountered it.  We switched hosting providers and moved our update site files to the new server and people are getting the same error.  I have confirmed it as well.  So, our feature (Fitnesse for Eclipse) fails when served from www.bandxi.com/fitnesse (hosted on TextDrive), but succeeds when served from www.bandxi.net/fitnesse (Debian Linux at home).  I am interested in the underlying reason why so I can offer the support folks at TextDrive some guidance beyond "it's broken".  Thanks.
Comment 6 Michael Spector CLA 2006-07-23 05:27:54 EDT
(In reply to comment #5)
> Apparently, this is potentially a more widespread problem - we just encountered

Can you check, that .jar extension is listed in mimetypes file and httpd.conf?
Comment 7 Vyacheslav Kvasnitsky CLA 2006-07-26 12:54:11 EDT
I have .jar extension in /etc/apache2/mime.types which points to /etc/mime.types
Comment 8 Eclipse Webmaster CLA 2006-10-03 19:46:25 EDT
As per comment 5, one consideration is that even if we fix the problem on download.eclipse.org, it won't fix the problem on our mirror sites - and they are likely "broken" like we are. Because they are run by independent organizations, I don't have any control over what they choose to do and not do.

I know this is a strange Java naming convention, but could renaming the files to org.eclipse_php.core_0.1.4.jar be a solution?
Comment 9 Seva Lapsha CLA 2006-10-09 09:09:10 EDT
We tested the mirrors, those of them which work, work also for *.php*.jar files. It means the problem only exists on download.eclipse.org.

I personally don't agree that renaming the packages is a good solution. Fixing apache's conf shouldn't be a big problem.
Comment 10 Seva Lapsha CLA 2006-10-09 09:16:41 EDT
As it seems to me currently, the problem may be either bad rewrite rule
expression (e.g. "\.php" instead of "\.php$") or Zend Download Server
misconfiguration (ZDS requires to mime-type downloadable files to PHP, but if
ZDS is disabled they run as PHP files).

Hope this info helps.
Comment 11 Gunnar Wagenknecht CLA 2006-10-09 09:30:41 EDT
(In reply to comment #10)
> As it seems to me currently, the problem may be either bad rewrite rule
> expression (e.g. "\.php" instead of "\.php$") or Zend Download Server
> misconfiguration (ZDS requires to mime-type downloadable files to PHP, but if
> ZDS is disabled they run as PHP files).

According to comment 0 it seems to be an issue with the Apache localization feature. Although, according to the Apache documentation, ".jar" should only be interpreted as a language if there is a "AddLanguage jar .jar" directive somewhere in the Apache configuration. This seems very unlikely, doesn't it?

http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addlanguage





Comment 12 Eclipse Webmaster CLA 2006-10-10 12:29:47 EDT
(In reply to comment #9)
> It means the problem only exists on download.eclipse.org.

This is false.

Here is the list of mirrors hosting an example of the affected file:
http://www.eclipse.org/downloads/download.php?file=/tools/php/updates/plugins/org.eclipse.php.core_0.1.4.jar&protocol=http

Out of 27 http mirrors listed, I got a PHP error or a blank page from 7 of them. So although I could fix this on download.eclipse.org, we'd need to fix it on all the other mirrors (which I have no control over).  And we'd have to make sure new mirrors also don't have this problem. It's also noteworthy that many mirror sites disable PHP script execution for security purposes, so those sites will allow your filename to work.

(In reply to comment #10)
> As it seems to me currently, the problem may be either bad rewrite rule
> expression (e.g. "\.php" instead of "\.php$")

We don't have such rewrite rules - mod_php4 handles PHP files.

> or Zend Download Server
> misconfiguration (ZDS requires to mime-type downloadable files to PHP, but if
> ZDS is disabled they run as PHP files).

We don't use the Zend Download Server.

D.
Comment 13 Eclipse Webmaster CLA 2006-10-10 12:31:37 EDT
Created attachment 51711 [details]
Screenshot of Open File dialog on download.eclipse.org

I added the .jar mime type on our servers, so this works well off a test download.eclipse.org server I set up.  This change should be propagated to the eclipse.org cluster by tomorrow.

I'll kindly ask our mirror sites to add the mime type to their configuration to fix this.
Comment 14 Michael Spector CLA 2006-11-22 10:04:09 EST
This is the solution, I've got from Apache guys:

Use e.g. "AddHandler default .jar" to prevent this; this is how mod_mime works,
see:  http://httpd.apache.org/docs/2.2/mod/mod_mime.html#page-header
Comment 15 Eclipse Webmaster CLA 2006-11-22 10:54:01 EST
This has been fixed on our cluster.  Note that this may still be broken on some mirrors.

-M.
Comment 16 Gadi Goldbarg CLA 2007-07-30 04:28:21 EDT
Seem to be working now
Comment 17 Daemmon hughes CLA 2008-03-17 16:25:26 EDT
I am getting this behavior when trying to  install the PDT plugin. The meesage I get is just like in bug 149492, which is marked as a duplicate of this bug. 

I am on OSX 10.4.11
Eclipse:
Version: 3.3.0
Build id: I20070621-1340
Comment 18 Denis Roy CLA 2012-07-24 13:23:33 EDT
For documentation's sake, I was experiencing this same issue on build.eclipse.org.

jar files are already defined as a mime-type, and download.eclipse.org has been handling PHP files differently (ie, not mod_php) than build, so here is the fix for build (from the Apache docs at http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext)

# Comment this out -- matches .php* files too
# AddHandler application/x-httpd-php .php

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>