browser trying to download php files
Posted by: FaithFreaks (---.dsl.wotnoh.ameritech.net)
Date: January 22, 2008 01:20AM

I just downloaded WAMPserver 2.0 on my new laptop and when I try to go to [localhost] it asks me if I want to save the file or choose a program to open it. [localhost] works fine and so does [localhost]. I cannot open any of the php files in my www folder though, even though if I click "www directory" it shows me that all the files are there (and if I try navigating to one it will ask me if I want to download it).

Options: ReplyQuote
Re: browser trying to download php files
Posted by: yfastud (Moderator)
Date: January 22, 2008 03:02AM

Make sure to access your websites through localhost and your files save w/ extension php not php.txt. Also use full tag <?php ... ?> if short_open_tag is not enable in php.ini

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: browser trying to download php files
Posted by: FaithFreaks (---.dsl.wotnoh.ameritech.net)
Date: January 22, 2008 03:15AM

yeah, I've done that ... all these files worked on my old laptop which had an earlier version of WAMP server on it. They're all in www folder and have php extension. I have short_open_tags enabled and I do primarily use <?php ... but when I type [localhost] it tries to download the file rather than open it through the server.

Options: ReplyQuote
Re: browser trying to download php files
Posted by: djnick007 (---.wmin.ac.uk)
Date: January 22, 2008 08:48PM

I had the same problem today, the browser insisted on (Opening/Saving the file) rather than actually RUNNING it!... and then realized its a problem with the browser itself. If you encountered that problem with iexplorer, give it a try with Mozilla Firefox, or vice-versa, gluck!

Options: ReplyQuote
Re: browser trying to download php files
Posted by: FaithFreaks (---.dsl.wotnoh.ameritech.net)
Date: January 22, 2008 08:58PM

I get the same deal in both browsers. To experiment when it asked me to choose a program to open the file I chose firefox.exe and of course it didn't parse the php but displayed it as an html page.

Options: ReplyQuote
Re: browser trying to download php files
Posted by: djnick007 (---.wmin.ac.uk)
Date: January 22, 2008 09:16PM

In that case im not too sure, I had that problem, I changed the default browser to (firefox - ie...when running wampserver for the first time) and now running properly. I'm pretty much sure its still a browser problem rather than the software problem, but I'd leave that to the moderator ( yfastud ) to help solve that problem for you!...

P.S.: I think I tripped over my own stone! Realized the php I was writing didnt have the good old "full php tag", good old lazy programming mistake once again.. eye rolling smiley
Which of the php.ini files do I enable the short_open_tags in? The Apache o the PHP .ini file?

Cheers,
Nick

Options: ReplyQuote
Re: browser trying to download php files
Posted by: yfastud (Moderator)
Date: January 22, 2008 09:36PM

@ djnick007
php.ini which can opened through wamp tray icon

@ FaithFreaks
Try to clear browser cache and cookies, then try again. If still not working, you might want to check your firewall or recently installed soft

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.