View local .PHP files in IE & Firefox?



               
I'm trying to view a local (on my HDD) .php file in IE7 or FireFox - but IE7 is asking to save or download the file, and Firefox just interprets it as text - all I see is the code.

Note that it was working until I formatted my PC, so it's a setting obviously... but I've forgotten how / where.

I don't run a PHP server locally on my machine, but note these files mainly contain HTML code, and I just want to view them for design / preview reasons. I don't care about not-seeing the PHP code until I upload it... but currently, I can't even view the files locally.

Any thoughts? :)
Thank you.

Answers:
PHP is a server side scripting code... this means that the script needs to be executed on a server before you can view them..

the only way to do what your after is to save the file... open it in notepad... then save it as "filename.html" (include the quote marks) and then play with it from there...

the script in the page will come up as ordinary text and may mess up the page layout... you'll need to play with it to get it right though :D

ALSO... if you say it worked before, then you may have had a server set up earlier (either IIS or Apache) it may be worth setting it up again
you can't view it if you don't have a local server running:

download wamp from http://www.wampserver.com/en/ and you will be able to view the .php in your browser (standard: http://localhost/subdomains if chosen)
change the file's extension to .html
if the file is saved with a .PHP extension you will need a local server that parse PHP, i.e. Apache. If they are saved as .html, you should be able to view them. Some html editors will give you a preview option for PHP files. Good luck!
PHP does not open by default if you have a IIS running. You need to integrate PHP with IIS and then only it will work.
You can as well make a web server integrated with PHP, MYSQL and IIS. See mysql and php web site. How I did it was :

Step by step guide
1. Installed the web server IIS4
2. Unzipped php-5.1.4-Win32.zip in C:\PHP
3. In Autoexec.bat (using command sysedit), added the Path : C:\PHP
4. Then run php-5.1.4-installer.exe.
5. Overwritten the C:\PHP\php.ini file.
6. Changed the following in c:\php\php.ini:
doc_root = c:\Inetpub\wwwroot
cgi.force_redirect = 0
extension=php_mysql.dll
extension=php_gd2.dll
include_path = ".:/php/includes"
extension_dir = "c:\php\ext\"

and restarted IIS. It started working
hi
please run Apache and then run file from localhost and run file in any browser. or open php file in dreamweaver without running Apache

The answers information post by website user , IEanswers.com not guarantee correctness.


  • What internet browser are you using right now?
  • Anyone know how to get flash installed in IE 7.0? I can go to adobe but my system hangs when that happens.?
  • My Microsoft Internet Explorer keeps saying error and has to shut down. How do I fix this?
  • Sometimes when i try to go to a website , as soon as i enter the link the internet explorer closes!!?
  • I did the update to Windows Internet Explorer and the icon for my Outlet Express is gone. I want it back ?
  • What is this? Cursor turns into miniture IE pg w/yellow box inset w/big red X on it & pg doesn't come up.?
  • Internet Explorer 7 question?
  • Help with Internet Explorer?