[SOLVED] how to save a file so that it can be opened in localhost
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Thanks for your kind replies. Please know that you are writing to a new Linux user. Let me explain my problem in a different way. Using Windows, any .html file can be opened in a browser. To open a .php file however, that file must be in the htdocs file in a XAMPP server, and the browser must access it through http://localhost
I am assuming the Linux var/www folder is like the Windows htdocs folder.
My question is, how do I, using Ubuntu, save a file (be it made in gedit or an IDE such as Quanta Plus) named test.php to the var/www folder [so that it can be opened using localhost]?
When I use the above command, it moves the file (test.php) to the /var/www/ folder. I can see that it is in that folder, and not corrupt. When I use localhost to open the .html file, it displays properly in the browser ("It works"). However, when I change the address to http://localhost/test.php, I get a popup that asks "What should Firefox do with this file?" I tried a second .php file, and it was moved to the /var/www/ folder, but again, the same popup appears instead of the web page.
Sadly, the sarcastic response you'd expect from a frustrated rookie is not given as an option in the popup.
My guess is that PHP is not installed/activated/working in LAMP. Is this a reasonable assumption, and if it is, should I start over and re-install LAMP?
I don't have LAMP installed on Ubuntu but the other Linux systems I have used always had these file in either /var/www/htdocs or /var/www/html. I guess that's not the case with Ubuntu?
My guess is that PHP is not installed/activated/working in LAMP
I would guess that your guess is correct. There is something wrong with the php configuration but the problem is it could be any number of things. Wrong Document Root in php.ini, needed php modules not loaded as well as others.
What method did you use to install LAMP. The link below gives what looks like the simplest way?