Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Sykje yn Support

Mij stipescams. Wy sille jo nea freegje in telefoannûmer te beljen, der in sms nei ta te stjoeren of persoanlike gegevens te dielen. Meld fertochte aktiviteit mei de opsje ‘Misbrûk melde’.

Learn More

Dizze konversaasje is argivearre. Stel in nije fraach as jo help nedich hawwe.

How do I open PHP documents locally?

more options

I'm trying to mirror a website, and firefox won't open (local) PHP files, even though they're identical to html files, only with a different suffix. It keeps asking me whether I want to "Save As..." or "Open with". When I try to open them with Firefox, I get the same dialog box...

Is there a way to get Firefox to recognize that it can open PHP files? Or at least treat them as html files? I went through the General Preferences, and even tried to change the default program to Firefox (And even tried "automatically" -- what a mistake!!), and kept getting the same dialog box. checking the code in my text editor showed that it was a simple html document. I would rather not have to go through all my files and change the suffix of every document from "php" to "html". I would think there's a better way. Is there a viewer plugin? or would it just be a fix in General Preferences -> Applications? On my Mac, it would show the document "type" beside the content type, ie. html/text.

(Ubuntu 18.04, Firefox 66.0.2)

I'm trying to mirror a website, and firefox won't open (local) PHP files, even though they're identical to html files, only with a different suffix. It keeps asking me whether I want to "Save As..." or "Open with". When I try to open them with Firefox, I get the same dialog box... Is there a way to get Firefox to recognize that it can open PHP files? Or at least treat them as html files? I went through the General Preferences, and even tried to change the default program to Firefox (And even tried "automatically" -- what a mistake!!), and kept getting the same dialog box. checking the code in my text editor showed that it was a simple html document. I would rather not have to go through all my files and change the suffix of every document from "php" to "html". I would think there's a better way. Is there a viewer plugin? or would it just be a fix in General Preferences -> Applications? On my Mac, it would show the document "type" beside the content type, ie. html/text. (Ubuntu 18.04, Firefox 66.0.2)

Alle antwurden (2)

more options

A PHP file is a server-side file, so generally you don't run those files locally. Firefox won't be able to run any of the PHP portion of your code.

That said, you should have no issues rendering the HTML portion in Firefox. Do you get the same issue if open the file within Firefox (pressing Command + O on your Mac keyboard)?

more options

How difficult would it be for you to set up a local Apache server on your Linux system so you can "serve" the files to your browser(s) on the loopback address http://localhost or http://127.0.0.1 (possibly adding a port number)?

Considering the various different restrictions on file:// addresses compared with http:// addresses, I think that would be a closer simulation of the actual server, too.