PHP pages cannot be viewed (trigger File Download prompt instead)

Author Message
Steve K. 10/26/2009 08:26 am

Because I cannot view most PHP files in the OEP view window, I am unable to do some of the research necessary for my job.

So I would appreciate any help from this forum. (My Google searches on this problem yielded nothing of use.)

Admittedly, this might be a problem with some other browser or WinXP (SP3) settings, and not necessarily rooted in Offline Explorer Pro (OEP). But then again, OEP appears to be built upon IE, so it seems this might still be an appropriate forum for this problem.

And if it is just a matter of entering the correct file-type info in Windows, then please let me know exactly what to enter.

Now here's the facts:

When I click a PHP website project name in OEP -- or when I click any php file names in the OEP Map tab -- the page usually fails to display in the OEP viewing window. Instead, I usually see a "File Download" window prompting me to save or open the file.

If I do save a PHP webpage to my desktop, then try to open it with a regular browser, I also have problems.

Choosing "Open With > IE" results in the very same "File Download" window appearing again. Likewise, "Open With > Firefox" triggers Firefox's own file download window, which also prompts me to save or open the file.

If I simply browse to a PHP webpage on the internet, it loads fine with either browser.

But offline, I cannot view these pages, and I used to be able to do so. (I can still save & view .asp pages and other server-generated webpages in OEP or my browsers.

Again, any advice would be appreciated.


PS: I suspect that installing Dreamweaver 8 might have caused this problem, but I'm not at all certain of that. Not at all.
Oleg Chernavin 10/27/2009 04:13 am
I think, there is a simple workaround - please select that Project and click the Export Files button. Select the location to copy files to and check the "Add standard extensions" box. Proceed with the export and see if the site works correctly offline now.

Best regards,
Oleg Chernavin
MP Staff
Steve K. 10/29/2009 08:45 pm
Thanks for the suggestion, Oleg. Of course, that would work okay if I had a very occasional PHP-based project to view.

But I have hundreds of PHP webpages in at least several dozen PHP-based projects, each downloaded daily, and monitored weekly to identify changes and the exact dates of any significant changes.

The latter task requires the Map tab, where I can view older, date-stamped copies of webpages, and where I can right-click the latest webpage(s) to view the 'date last modified' in the Windows file properties tab.[*]

[*Btw, I would love it if OEP offered a setting so a file's last-modified date would appear on OEP's status bar whenever a file is selected in the Map tab.]

So anyway, after some experimentation and searching around, I made the PHP files work once again, so they can be viewed in OEP, or saved to my desktop & double-clicked to open in my browser.

Admittedly, I might have problems again -- and maybe different problems -- when I install a server on my PC to develop & test my own PHP files for uploading to my own website, but for now everything works.

(I wouldn't necessarily recommend that anyone else copy my steps, but if someone has the same problem, and doesn't know what else to do, then consider trying the following. Run regedt32, then go to HKEY_CLASSES_ROOT, and make the php and phpfile entries identical to those under html and htmlfile. Then test PHP files in OEP and try saving a PHP file to your desktop, and opening it. If you find that php files saved to the Desktop look like text files, then go to Control Panel > Folder Options > File Types > PHP > click "Restore" button. These steps, though a little unorthodox, worked for me.)

(And of course, any registry editing should be preceded by full registry backups. I recommend using ERUNT for manual backups and for daily automatic date-stamped backups of the registry. It includes a great emergency restoration program too.)

Oleg Chernavin 10/30/2009 06:24 am
It is strange that you have to do such Registry modifications. The Internal server in Offline Explorer should pass correct MIME types of all files to the browser. This may happen only if descr.wd3 files are removed or if you turned off the Internal server in the Options dialog.

I added the file modification date to the status bar when you browse the Project Map. Also, there is an easy way to get the list of recently loaded files for a Project - select it, click the Find Contents button, keep keywords field empty and check only the "Recently loaded files only" box. This search will output the list of such files.

Steve K. 10/31/2009 09:20 pm

Thanks for adding the status bar feature for the Map tab!

And thanks for the tip, too. It could be useful w/ my larger projects, or when I'm running out of time and must quickly check a lot of projects.

(I'm using more & more content filters too -- that's a very valuable feature for me, since I can use it download not just modified files, but files modified in certain ways. At least that's how it works with some webpages. Other webpages require content filters w/ support for boolean and/or regular expressions. I'm keeping my fingers crossed that such support will be added.) (Btw, I already have TextPipe Pro.)

Regarding the main topic of this thread...

The PHP problem, as I'd indicated, wasn't just evident in OEP. It was also evident whenever I would save a PHP webpage to my desktop or any local drive, and then try to view the downloaded PHP webpage.

Even when a PHP webpage was already downloaded, my browser would open a download dialog window asking me where to save the file if I double-clicked it. And telling the browser to open the file would just cause problems. But viewing PHP websites 'live' online was never a problem with any browser or OEP.

So, somehow the file association settings were changed. Again, I think this occurred when I installed Dreamweaver 8 and, initially, configured PHP files to be my default file type in Dreamweaver. Inquiries on other forums can be found describing this same problem, and referring to Dreamweaver -- but only version 8.

In any case, it does work well now.

Again, thanks for the status bar improvement. I wasn't sure you'd see that request in my lengthy message(s).

Oleg Chernavin 11/02/2009 07:25 am
OK. Regarding boolean expressions - can you tell me more on what you need? Maybe I will be able to do something simple fast.

I see about PHP. Really strange, but I would need to reproduce it myself to understand. I will keep my eyes open on that.