Forum Moderators: open

Message Too Old, No Replies

Browser won't open local PHP files, only Dreamweaver will.

doesn't matter what I set in Open with...

         

Grump

6:09 pm on Oct 12, 2005 (gmt 0)

10+ Year Member



If I double-click a PHP file on my computer, it will not open in any browser. After installing Dreamweaver, double-clicking a PHP file opened it in Dreamweaver. I wanted it to open in a browser, so I changed the Open with... attribute. The file's icon never did change from the Dreamweaver one, but then it wouldn't open in Dreamweaver either. I can't even open the browser and then browse to the file to open it. It just won't open.

If I return the Open with... attribute to Dreamweaver, the file will open when I double-click it or select "view in browser" from my text editor (NoteTab Pro). Selecting "view in browser" from Dreamweaver will not work either. The file will not open in a browser under any circumstance except if the file is on my actual web server.

Maybe someone can help me with this. I saw a fairly recent thread concerning this same problem, but it had no final resolution. It was past the age of allowed replies, so I began this new thread.

Thanks for any assistance.

Grump

HughMungus

6:30 pm on Oct 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you can open PHP files as web files on your computer without a PHP server to render them. Try a PHP emulator program.

Sathallrin

7:00 pm on Oct 12, 2005 (gmt 0)

10+ Year Member



You can try opening from the address bar... such as typing c:\folder\file.php into it.

This will display some of the contents of the file... although it will not run the script unless you setup a local webserver on your machine.

Matt Probert

7:16 pm on Oct 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's certainly worth installing Apache on your PC, or if you have a LAN so much the better. It will enable you to check PHP and other scripts without suploading them to your hosting PC.

And it's free.

Matt

maccas

7:17 pm on Oct 12, 2005 (gmt 0)

10+ Year Member



Try this, open any folder and tools > folder options > file types select php > change and select your browser. If it is not on the list select new and add .php... when opened in a browser it will only show the source though, you need to install apache or a windows server and php.

jatar_k

7:20 pm on Oct 12, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you need to actually install php/apache on your machine to run files locally.

my suggestion

for now just upload the files to your server in a 'test' location to run them

if you do want to install a local development environment there are threads about it in the PHP Library [webmasterworld.com]

Grump

12:30 am on Oct 13, 2005 (gmt 0)

10+ Year Member



Thank you everyone, for replying to my problem.

I am sure that I was able to open the file (a web page called index.php) in the browser before. Maybe old age and mental infirmity has made me clueless though. I will look into Apache and consider installing it on my PC -- or maybe even set up a private server on my LAN just for this purpose (doubt I would have the throughput to use it publicly).

To clarify for some of you:

"...opening from the address bar... such as typing c:\folder\file.php into it." Which is the same as using the open command -- won't work.

"...open any folder and tools > folder options > file types select php >..." Been there, done that. ;) Thanks though.

Thanks again, all. It's off to the [development] lib'ary for me.

Grump

moltar

1:10 am on Oct 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might need to set the correct mime type (text/html) for php files. You can do that in Windows Explorer -> Tools -> Options -> File Types.