Jump to content

[SOLVED] How do you make a PHP file in WAMP?


Recommended Posts

I have recently installed PHP and Apache on my local computer. I THINK that PHP is working, but everytime i go to localhost to check, it shows a directory with a file called PHPinfo.php.txt. This file is supposed to be able to tell you everything about PHP, so i clicked on it, and there's a clean page with the writing "<?php phpinfo(); ?>" in the top corner. I can't understand why it doesn't show that page with all the information, please tell me why it doesn't work! I think it has something to do with the file extension being .php.txt. Please help!

Link to comment
Share on other sites

I don't know how to, it always adds that, no matter what kind of extension, except html. I tried a .bat extension for something else, and it just opened the text document. it was saved as phpfolder.bat.txt!

How do i change this?

Link to comment
Share on other sites

I don't know how to, it always adds that, no matter what kind of extension, except html. I tried a .bat extension for something else, and it just opened the text document. it was saved as phpfolder.bat.txt!

How do i change this?

I guess you are using notepad. Whn you go to save files in notepad it will always add a .txt file extension even if you have already defined one. To stop notepad from adding the .txt extension make sure the File Type field is set to All Files and not Text Document before you click the save button. Also make sure you save your php files in C:/wamp/www if you have WAMP installed.

 

When you want to run your php files go to http://localhost/name-of-file-to-run-here.php - change name-of-file-to-run-here.php with your actual php file you want to run.

Link to comment
Share on other sites

  • 4 weeks later...

Sounds like one of the Windows features that makes me want to bang my head on the monitor.

Open any folder,

click the 'Tools' menu,

select the 'Folder Options' menu item,

click the 'View' tab,

uncheck 'Hide extensions for known file types',

click 'Apply' or 'OK'

 

You can now see the .txt extension in the Explorer (Not Internet Explorer) window and rename the file to remove it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.