I installed XAMPP, but I am getting that error. I tried reinstalling it but I continue to get that error. I have no clue what else to do since I have never done this before. Someone HELP!
What OS are you running? I have run into major hassles on 7, so I switched to one of the wamp variants and it solved all problems. Zend server is free and works too, And you know to turn Skype off before running, right?
I figured it out. Totally a n00b thing, but I was trying to double click the file to open it. Even though it's n00b of me to do that, shouldn't there be something to say that you need to type a url like http://localhost/ instead of double clicking the file?
Double-clicking an .html file? No, that's like signs on traffic lights telling you to stop on red and go on green. It's too elementary for there to be "something". Double-clicking oin a file - any file - opens it in the default program for the extension. Computer 101.
I think you misunderstood. Double clicking the php file DOES NOT cause the file to open in a browser properly. On the contrary, instead of double clicking the file, you have to go to http://localhost/ .
I understood exactly what you said. What program runs which extension is something local to your computer. If that's the way you have it set up, that's how it works. Double-clicking a php file opens it in the default browser in Windows (that's how Windows comes). Since that's not what you want to happen to a php file, double-clicking it is not the way to run it. This is a case of operator error (due to operator misunderstanding). The computer was working the way it should.
(Is it OK to reply to a years-old thread?) offthedome was very helpful to me in this thread. Thank you. Related question -- I know that browser-open: "filename.php" does not work, that you need localhost/pathname/filename.php. Would somebody please give a few words explaining why the former doesn't work and the latter does? Thanks, Dave
browser-open: "filename.php" is trying to open the file "filename.php" in the default path you have set in Windows. If the file isn't there the browser won't find it. It's like my telling you to go to Main Street. Unless I mean the "Main Street" in the town we're standing in, I have to tell you which town too. That's what "localhost/pathname/" does - it tells the browser where to find "filename.php". The reason you can get away with just "filename.php" when you're online is that the person writing the site makes sure that "filename.php" is in "localhost/", which is the default path for the web server. If the file is in "localhost/pathname/" you have to specify it too. (Best practices call for any file the user can access to be in the root [localhost in your local installation] and files below that directory to be linked to by files in the directory - and no access for the user below it.)
Thank you, but I should have been more clear -- I was questioning just what difference "localhost" made. So 1) pathname/filename.php vs. 2) localhost/pathname/filename.php I know "localhost" puts it under the server-http business, but that doesn't sound very good. Please explain in better english. Rukbat, I love your "Required reading". I'm going to spend more time on it.