metrov Posted April 21, 2008 Share Posted April 21, 2008 Hi, I'm a designer, currently building pages in HTML with .php extensions, because the pages will ultimately be programmed with php. Well, on my home office computer, I can open the pages with .php extensions with either Firefox or IE -- no problem. Just right-click the files, and "Open With", and they display perfectly. But now I'm working on the pages on my work office computer, and can't open them with either browser. When I try to open the pages to view in the browsers, both browsers ask me to either 'open' or 'save.' But neither will actually open the pages. What's strange is, I believe I have the same browser versions on both my home and work machines. I need to view my .php pages in both browsers while I'm laying them out. Does anyone know what the problem could be? Thanks so much Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/ Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 Hi, I'm a designer, currently building pages in HTML with .php extensions, because the pages will ultimately be programmed with php. Well, on my home office computer, I can open the pages with .php extensions with either Firefox or IE -- no problem. Just right-click the files, and "Open With", and they display perfectly. But now I'm working on the pages on my work office computer, and can't open them with either browser. When I try to open the pages to view in the browsers, both browsers ask me to either 'open' or 'save.' But neither will actually open the pages. What's strange is, I believe I have the same browser versions on both my home and work machines. I need to view my .php pages in both browsers while I'm laying them out. Does anyone know what the problem could be? Thanks so much You can't open .php files in your browser with Open. You need to run them on a web server (like Apache), which has the PHP parser installed, and it can display the PHP files. The .php extension should ONLY be used if you have a running web server. Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523071 Share on other sites More sharing options...
p2grace Posted April 21, 2008 Share Posted April 21, 2008 There are portable apache servers that you could install and run the php pages off of to test. http://www.pendriveapps.com/2007/06/01/xampp-portable-web-server/ Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523077 Share on other sites More sharing options...
MadnessRed Posted April 21, 2008 Share Posted April 21, 2008 i get the same problem, I am browsing round the internet, then (usually on a forum) my computer seems to forget that php files are a website so asks so I want to download the php file of open it. either 1 i view just downloads it and then open just asks me what I want to view it with. any ideas as it can get very annoying if I am trying to post on a forum and I click the submit button and it comes up with a dialog box for submit.php or whatever the files is called. Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523083 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 @MadnessRed: That means that the server you're accessing isn't configured properly. Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523085 Share on other sites More sharing options...
metrov Posted April 21, 2008 Author Share Posted April 21, 2008 Ok, everyone's telling me it's not possible to view .php pages in a browser unless they're running on a server. But that's the strange part -- I'm telling you, I can view them on my browsers on my home computer [which is not running any server], but not at work. And I don't know what could be different about the machines. I will look into the Apache servers. Do designer/developers who build .php sites always have a server installed on their local machine in order to view their pages? Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523087 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 Well, metrov, that's very strange. It's probably because there's no PHP in it, partly. If there was PHP in it, the PHP would just display the source code right onto the browser window. And yes, every developer has a local Apache server or a hosted server that they use. I host my own server, personally. =) Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523089 Share on other sites More sharing options...
Wolphie Posted April 21, 2008 Share Posted April 21, 2008 In order for PHP scripts to execute, you need the PHP parsing engine/library configured correctly to run with a webserver such as Apache or Lighttpd. It isn't possible for a browser (Firefox in your case) to execute a Server Side (PHP) script. Only web servers can recognise server side MIME types, unless you're executing the script locally in which case a server isn't required. (PHP isn't just for web development). Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523091 Share on other sites More sharing options...
p2grace Posted April 21, 2008 Share Posted April 21, 2008 If there isn't any php in the page then why not just rename the file to use the html extension. Then when you're done designing it change the file extension to php? Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523093 Share on other sites More sharing options...
metrov Posted April 21, 2008 Author Share Posted April 21, 2008 I believe that's the answer -- there's no code in the pages yet on my home computer. But the pages on my work computer must have some code in them that's preventing them from being opened by the browsers. I think the best and easiest solution for me at this point is to just leave the .html extensions for now, then change them when ready to turn over the my programmer. Thanks for all the help! Quote Link to comment https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523095 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.