So I installed Easy PHP on my computer. How do I get php files to execute in my browser? When I open them right now it asks me what program I want to use instead of executing the code.
Make sure everthing is running: Apache, MySQL and PHP You can check that by typing http://127.0.0.1 or http://localhost in your Browser. Then you could make an .html file with something like this: <html> <head> <title>My First page in PHP</title> </head> <body> Current date : <?php print (Date("l F d, Y")); ?> </body> </html> HTML: If it is working you are done. Now you have to read some books and manuals about .php, Apache, and MySQL.
No I meant .html But this is just to test it. There is a php script init: <?php print (Date("l F d, Y")); ?> PHP: If it is working you know you have everything set up correct. And then you can make your .php files.
It's pointless to create a .html page with PHP code. It's unlikely that Apache will be configured out of the box to parse .html as PHP so all it will do is output PHP code.
No its not pointless. It does its job. Because its just an example to test his configuration, which is his problem I guess. I even took it from the online installation manual of easy php
I guess an Apache server configured to parse .html as PHP has to be expected with something called "Easy PHP".
If he ever wants to learn it well - EasyPHP may be a good intro but putting PHP in .html files is horrible practice. I learned with Xitami and later XAMPP - I'm not saying that software is bad to use. But mixing file extensions can be a nightmare, and it should be avoided as soon as possible.
I think you missunderstood me. I'm not saying it parses .html as .php it just execute the script in the .html as php, just to check that its working. And that does every php environment. And if you ask me a decent Deabian LAMP would prevent such problems at all.
Icheb is right, unless apache or your server daemon is configured to execute php inside .html files it will not work.