Question:
localhost ubuntu?
René
2014-07-15 10:22:28 UTC
Hi all! I'm in trouble with the localhost of Ubuntu..... when I type into the url "localhost" or "127.0.0.1" it appears this http://www.rodio.tk/localhost.png instead of the typical message "It works!".... why??
Then, another question... I want to program in php (in Ubuntu)... how can I do it? I'd like to run my scripts like windows' easyphp sotware, which can deal with mysql databases and so on...
Thank you all!
Three answers:
Chris
2014-07-15 13:15:33 UTC
Short answer: a web server will look for index.html and index.htm

If it can't find either, it will show the directory content instead, this is what you are seeing right now.

To use php, you need to install it. Like Franco suggested, use xampp to do this.

Then create a folder in your web root folder (your web root folder is the folder that contains the files you see in your screenshot).

Say you name the folder "mysite". Then write some php code and save it in that folder as "index.php".

Now go to http://localhost/mysite
?
2014-07-15 10:31:56 UTC
What do you see when you click on the index.lighttpd.html file? If you click on this file and the page does what you are expecting, it means that your web server has not been configured to use "index.lighttpd.html" as the index landing page. Actually you should be able to rename that file to index.html and it should work the way you want it to. Either way. You'll probably learn a lot more about how to configure a web server if you go with the first option.



To learn PHP go here:

http://www.w3schools.com/php/
?
2014-07-15 10:40:25 UTC
Hi all! I'm in trouble with the localhost of Ubuntu..... when I type into the url "localhost" or "127.0.0.1" it appears this http://www.rodio.tk/localhost.png instead of the typical message "It works!".... why??



If you have Ubuntu installed on your computer, and you never installed XAMPP on your computer, then you will have problems. It seems to me a domain is taking priority, and localhost is not being used. Your localhost is an image, and it's in your root directory of your domain name. Your root directory could be: public_html, html, or maybe your domain name.



INDEX OF / means you have no index.php web page in your root directory.



You have to use XAMPP with Ununtu.

I suggest you find, and use a guide to learn how to install, and use XAMPP on your computer. You might have some problems installing XAMPP on your computer, but don't give up. Eventually you should be able to install XAMPP on your computer.



You would put an index.php web page that you make inside your htdocs folder. Your htdocs folder should be on your computer after you install XAMPP on your computer.



Guide to find htdocs folder:



After you finish using your terminal, go to File System.



Next click on your opt folder.



Next click on your lampp folder.



Next click on your htdocs folder.



Lastly put your web pages inside your htdocs folder.



Make sure when you make your index.php web page that you make it like how I typed it. Don't put anything before, or after index. Make sure you only have one index.php web page inside your htdocs folder.



After your website is inside your htdocs folder, close all your windows, and then open your web browser. In the top address bar type localhost.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...