You are not logged in.

#1 2020-09-08 14:06:46

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 326
Website

Need firefox to open local PHP files and not download them

Hi there folks!

My FF on other machines(windows, notably) open my PHP files to display embedded content.  On my BL install, FF goes to the local URL and then asks me whether I'd like to download or open in firefox.  If I choose to open in firefox without using localhost, I just create a never-ending loop of downloaded files. 

If I move the files to my web root(localhost/schwim), the file opens properly. I would like the files to open even when not using localhost because I'd have to move the files back and forth to work with and then view them.

Does someone know how I could get FF to treat the local php files differently?

Thanks for your time!

Last edited by schwim (2020-09-08 14:21:10)


Schw.im! A social site with an identity crisis.

Offline

#2 2020-09-08 18:01:50

ohnonot
...again
Registered: 2015-09-29
Posts: 5,532

Re: Need firefox to open local PHP files and not download them

Firefox (or any browser that I know of) cannot parse PHP so I don't know what or why you want to do that.
What would it open?
Local PHP files or from your server?
What would they show, if it worked like on "windows, notably"?
I just cannot wrap my head around it.

Last edited by ohnonot (2020-09-12 21:33:25)


Give to COVAX! Here or here. (explanation)

Offline

#3 2020-09-08 20:41:13

damo
....moderator....
Registered: 2015-08-20
Posts: 6,660

Re: Need firefox to open local PHP files and not download them

A brief websearch came up with this in the first hit:

Firefox has never processed PHP code natively. You need to have server software running locally that processes the PHP code and that sends the resulting file as text/plain instead of application/x-httpd-php.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2020-09-09 14:22:17

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 326
Website

Re: Need firefox to open local PHP files and not download them

Hi there guys, thanks very much for the help! I need to keep reading up on how linux handles mimetypes I think to get what I need.  I'll update the topic if I sort it out but otherwise, will just keep this a Windows-type thing if I need it.

Thanks again!


Schw.im! A social site with an identity crisis.

Offline

#5 2020-09-12 21:35:21

ohnonot
...again
Registered: 2015-09-29
Posts: 5,532

Re: Need firefox to open local PHP files and not download them

schwim wrote:

Hi there guys, thanks very much for the help! I need to keep reading up on how linux handles mimetypes I think to get what I need.  I'll update the topic if I sort it out but otherwise, will just keep this a Windows-type thing if I need it.

So, what eactly does Windows do with these PHP files? Display them in a text editor?
Or do you have PHP installed on your Windows machine, and some way to parse & display them locally?
I don't see how mimetypes come into it...


Give to COVAX! Here or here. (explanation)

Offline

#6 2021-03-06 01:48:16

Davy
Member
From: Ireland
Registered: 2016-05-31
Posts: 65
Website

Re: Need firefox to open local PHP files and not download them

This is a kinda old thread so sorry for poking my nose into it, but the bl-welcome script can install an apache server very easily and neatly. It installs the whole LAMP stack and then all you need do is put your php files in htdocs in your homefolder and go to localhost in firefox.

From my limited understanding, since php is a serverside script, it's not firefox's job to process it. You need to install the apache server so it can do the role of the actual server in processing the php and serving the processed html to firefox. Maybe there was something similar on your windows preinstalled?

You can run the bl-welcome script again by running "bl-welcome" in the terminal. When you get to the bit where it asks if you want to see the development tool options, say yes and yes again when it asks about the LAMP stack.

Offline

#7 2021-03-06 02:06:24

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 326
Website

Re: Need firefox to open local PHP files and not download them

Thanks for your thoughts Davy,

I didn't need firefox to parse php.  I needed it to parse the HTML outside of the PHP code.  The issue was sorted by using Firefox on the Windows side.

thanks again!


Schw.im! A social site with an identity crisis.

Offline

Board footer

Powered by FluxBB