I am a newbee and I setup notepad to be the default editor for php extensions. Now everytime I try to execute php files they open with notepad instead of executing in the browser. I have re-installed everything (PHP, mySQL, APACHE), to no avail. Can someone please tell me what to do. When I change the open with to explorer, it still doesn't execute. All help is appreciated.
[RESOLVED] PHP executes in notepad, need help
Can someone please check their computer and see what is the default to open php file. And, also the path for the icon. Thanks guys
You cannot launch PHP files by double-clicking on them (well...maybe if you've written them as command-line applications, but not as web applications). The files must be in your web server document root directory or a sub-directory of it (typically called "www" or "public_html"), and then you launch them from within your web browser by typing "http://localhost/filename.php" in address bar (or "http://localhost/subdir/filename.php" if it is in a subdirectory of the web root).
Files are working on submit but when I try to execute the code, it opens the file as a text document.
The quote to the first file that asks for execution is:
<html>
<head>
<title>Link Demo</title>
</head>
<body>
<center>
<h1>
Link Demo</h1>
</center>
<ul>
<li><a href = "hiUser.php?userName=Vikram">Hi Vikram</a></li>
<li><a href = "http://www.google.com/search?q=crawler">
Google search for "crawler"</a></li>
</ul>
</body>
</html>
The second file that it asks for and which opens up in text format is:
<html>
<head>
<title>Hi User</title>
</head>
<body>
<h1>Hi User</h1>
<h3>PHP program that receives a value from "whatsName"</h3>
<?
print "<h3>Hi there, $userName!</h3>";
?>
</body>
</html>
Create a new file called "phpinfo.php". Edit it so that it only contains the following text:
<?php
phpinfo();
?>
Save it in your root web directory, then call it from your browser as "http://localhost/phpinfo.php". If it does not display a whole bunch of information about your PHP installation, then your PHP and/or Apache set-up is flawed.
It gives me all the info on PHP in a lot of frames.
Its started to work all of a sudden. Thanks for the help.