0

I am new to php and utilizing WAMP platform (version 3.0.6). I have two php files, one is a database connection script to the MySQL databse I created, the other is an html web form with embedded php scripts. Both were created in Microsoft Notepad as my editor and saved with the extension (.php) in the Windows(C:) >wamp64 >www >demoproject folder. While browsing in Windows explorer I noticed the file type is saved as "Text Document", even though the extensions were both saved with .php.

When I launch localhost in my browser and select the project folder listed under Your Projects I receive an error "This site can't be reached". Not sure why this is happening. I am able to open the root directory if I navigate to localhost/demoproject , which from there I can see the two php files (saved as Newspaper2.html.txt and connect-mysql.php.txt). When I launch the newspaper file (html form with php) all I receive is the scripting I created, as opposed to opening the web form. I checked the port for the localhost and I am running on port 80, and I've tried playing with the file extensions a little but it hasn't helped. Apologies if this has been asked before, I didn't see anything specific to this issue. I appreciate any assistance! Thanks.

Kevin
  • 33
  • 9
  • Are you able to remove the .txt extension? – Sheedo Aug 31 '17 at 16:05
  • I've saved the file name ending in (.php) but it continues to indicate that the type of file is a Text Document. Should I trying saving this in a different editor, othern than Notepad? – Kevin Aug 31 '17 at 18:00
  • Click on `save as` then under `save as type` select `all files` instead of `text file`, and give the extension you want. Good luck! – Sheedo Aug 31 '17 at 19:17

1 Answers1

0

Files that don't end in .php will not be interpreted unless you have configured their extension to be interpreted in your php.ini.

Basically: remove the .txt from the end.

catbadger
  • 1,662
  • 2
  • 18
  • 27