andyd01 wrote:You can create a file with the Microsoft NotePad/WordPad editors and give it a name like "test.php" and put this file in the htdocs directory and when you set your browser to
http://localhost/test.php, you will get an error page that says Object not found.
The correct and only detailed error message may be found in the Apache error.log file, browser errors are only canned messages with no individual error detail provided and so are only a preliminary warning that something is not quite right.
andyd01 wrote:This is happening because the file created by NotePad/WordPad is a "text file", not a "php file". Look at the files in the windows explorer, view, detail and you will see the file type names in one of the columns in the middle.
Incorrect because a php file
is a text file and the indicated column is not indicative of the format or content of a file only it's actual file extension associated with that file - for example if you change the test.php into test.txt then it will show as a text file which of course it is.
Using a text editor is mentioned in several locations on the XAMPP home pages as well as in the FAQ.
Only use a
pure text editor like Notepad, not an RTF or Word editor like WordPad, or like you did use a dedicated script editor and there are many that fit that bill, to edit and read php files which are indeed only pure text files - an RTF or Word editor are not text file editors and they include all sorts of unknown invisible formatting characters as well as some visible character differences to a text editor into a file which Apache does not recognize and so throws out the code when parsing, with an error message.
I use and have used NotePad Pro, a notepad pure text and code editor replacement, for years to edit all manner of scripts including but not limited to php with absolutely no issues at all.
BTW Notepad should not be quoted in the same context as WordPad as they are two different types of editor, you can use Notepad to edit all editable files in XAMPP but not WordPad in it's default file save state of RTF, which is what you appear to have done, instead of changing the default Save as RTF to Save as Text Document for your test.php file.
So before posting in these forums please check your facts first.
For the record:
Notepad Overview wrote:Notepad overview
Notepad is a basic text editor that you can use to create simple documents. The most common use for Notepad is to view or edit text (.txt) files, but many users find Notepad a simple tool for creating Web pages.
Because Notepad supports only very basic formatting, you cannot accidentally save special formatting in documents that need to remain pure text. This is especially useful when creating HTML documents for a Web page because special characters or other formatting may not appear in your published Web page or may even cause errors.
You can save your Notepad files as Unicode, ANSI, UTF-8, or big-endian Unicode. These formats provide you greater flexibility when working with documents that use different character sets.
WordPad overview wrote:WordPad overview
With WordPad, you can create and edit simple text documents or documents with complex formatting and graphics. You can link or embed information from other documents into a WordPad document.
You can save your WordPad file as a text file, rich text file, text file for MS-DOS, or Unicode. These formats provide greater flexibility when working with other programs. Documents that use multiple languages should be saved as rich text files.