[clue-tech] viewing php files in firefox

Matt Gushee matt at gushee.net
Fri Oct 21 11:22:17 MDT 2005


Angelo Bertolli wrote:
> For the longest time I was really frustrated with Linux/Firefox for not
> allowing me to view my php (html embedded with php) files as html
> files.  I finally figured out how to massage gnome into allowing this,
> so I thought I'd share.  Just set the PHP mime type to text/html by adding:
> 
> text/html php
> 
> to the file .mime.types
> 
> Pretty easy.  Obviously if I open a PHP file with my browser, I want it
> to be treated like HTML.  Why would I try to open it with firefox only
> to get firefox to ask me what to open it with?
> 
> Personally, I think this is a bug in firefox, but making a php file
> pretend to be text/html works too.

Depends on how you define bug, I guess. It might be more accurate to say
"out-of-spec" ... at least if you look at Firefox as an
end-user-oriented *Web* browser (as opposed to a local file browser).
Except maybe for testing purposes, a well-configured server should
*never* serve PHP, just HTML generated from PHP. Of course we know that
the real world is a bit more complex, especially for Web developers ...
and I don't doubt that you have a valid reason for wanting to use
Firefox in a way that its designers didn't intend ...

It really should be easier to configure internal/external handlers,
though. I've had my own struggles with this ... for one, I sometimes
want to play MP3s, and apparently there are several possible mime types
for MP3s. Depending on which one the server has chosen, Firefox
sometimes wants to play them with RealPlayer. Now why in God's name
anybody would want to use RealPlayer for MP3s when XMMS is available, is
beyond me. But there it is. And if I want to select a different handler
I have to give a full path. And in the latest version of the file dialog
you can't type in the full path, you can only select with the mouse, so
... click up to /, double-click usr/, double-click bin/ ... wait a few
seconds for the 1,981 files in /usr/bin to be displayed, scroll waaay
down and select xmms. Oh, and there is no way to change the default
handler through the GUI. AAARGH!!

That's not a bug, that's seriously broken design. I suppose the
intention was to simplify the interface, but I don't see how this can be
good even for rank newbies ... even if you have a faster machine and
fewer files in /usr/bin, as most people probably do, it's gotta be slow
and tedious (and how many non-geeks would figure out the path,
/usr/bin/xmms, anyway?).

Well, sorry to go off like that. Maybe I should file a bug report? I
will if it'll do some good. Trouble is (a) I suspect at least some of
this stuff has been done on purpose; and (b) it's not clear whether the
guilty party is Firefox itself, or GTK, or GNOME, or some combination.
Meanwhile, I wonder if .mime.types will work for my MP3 problem. See if
I can get that going.

Thanks for the tip!

--
Matt Gushee
Englewood, CO, USA
_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list