Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Http://localhost/ Not found. help please!

  1. #1
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Unhappy Http://localhost/ Not found. help please!

    Hi there.

    I'm currently learning how to program in PHP i have recently installed LAMP server and apache2 and MySQL, i have run a bunch of commands, so i can really remember them all..
    the ones i can remember is:

    Code:
    apache2 php5-mysql libapache2-mod-php5 mysql-server
    sudo tasksel install lamp-server
    sudo apt-get install apache2
    and when i entered Http://localhost in my browser bar i got a screen saying it worked but no content has been added.
    I tried put my test file (called index.php) into /var/www/ still not worked renamed it to index.html still not worked.
    tried http://localhost/index.php and with index.html wasn't working.

    ___


    i woke up today to try find out what was wrong.
    BUT NOW I CAN'T ENTER Http://localhost nor http://127.0.0.1
    I got a "server not found" screen like when you enter an incorrect adress


    i tried to restart apache using:
    Code:
    sudo /etc/init.d/apache2 restart
    but get's

    * Restarting web server apache2 apache2: Syntax error on line 233 of /etc/apache2/apache2.conf: Syntax error on line 12 of /etc/apache2/conf.d/index.php: Expected </?php> but saw </div>
    [fail]

    and i'm lost! what do i do, PLEASE HELP ME.
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Http://localhost/ Not found. help please!

    index.php shouldn't be in /etc/apache2/conf.d/
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Http://localhost/ Not found. help please!

    Quote Originally Posted by CharlesA View Post
    index.php shouldn't be in /etc/apache2/conf.d/
    it's not the index.php i made.
    either i don't know what you mean by that post :/
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Http://localhost/ Not found. help please!

    Post the output of this please:

    Code:
    ls -l /etc/apache2/conf.d/
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Http://localhost/ Not found. help please!

    Quote Originally Posted by CharlesA View Post
    Post the output of this please:

    Code:
    ls -l /etc/apache2/conf.d/
    i got this output

    totalt 20
    -rw-r--r-- 1 root root 269 2010-11-18 22:16 charset
    -rw-r--r-- 1 root root 21 2010-12-14 14:46 fqdn
    -rw-r--r-- 1 allan allan 208 2010-12-13 18:28 index.php
    lrwxrwxrwx 1 root root 45 2010-12-13 21:55 javascript-common.conf -> /etc/javascript-common/javascript-common.conf
    -rw-r--r-- 1 root root 3296 2010-11-18 22:16 localized-error-pages
    lrwxrwxrwx 1 root root 28 2010-12-13 21:56 phpmyadmin.conf -> ../../phpmyadmin/apache.conf
    -rw-r--r-- 1 root root 1481 2010-11-18 22:16 security
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

  6. #6
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Http://localhost/ Not found. help please!

    Yep. Somehow index.php got moved there, and shouldn't be there.

    Move it somewhere else for the time being - maybe yer home directory and then try to restart apache2.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  7. #7
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Http://localhost/ Not found. help please!

    Quote Originally Posted by CharlesA View Post
    Yep. Somehow index.php got moved there, and shouldn't be there.

    Move it somewhere else for the time being - maybe yer home directory and then try to restart apache2.

    WOAH IT WORKED!! thanks for that

    now time for the next problem xD one problem rarely comes alone..

    do you know where i should put that index.php file i made.. so that i can see it in http://localhost ?

    as said above i currently have it in var/www/ so i have tried enter http://localhost/index.php

    but i only get a white blank screen
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

  8. #8
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Http://localhost/ Not found. help please!

    i don't know if it's a mistake i done in the PHP file so i post the code of it here

    <html>

    <body>
    <?php
    //this is for testing PHP
    echo "welcome to the first PHP script"
    echo "<br>"
    echo "AND welcome to PHP"
    ?>
    </body>
    </html>
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

  9. #9
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Http://localhost/ Not found. help please!

    If you get a blank page, can you view the source and see php code?

    EDIT: Try creating a file with this:

    Code:
    <html>
    <head>
    <title>PHP Test</title>
    </head>
    <body>
    <?php phpinfo(); ?>
    </body>
    </html>
    Save it as phpinfo.php

    Then open it the browser.

    See here.
    Last edited by CharlesA; December 14th, 2010 at 04:23 PM. Reason: added link.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  10. #10
    Join Date
    Apr 2010
    Location
    40 cm from the screen
    Beans
    130
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Http://localhost/ Not found. help please!

    Quote Originally Posted by CharlesA View Post
    If you get a blank page, can you view the source and see php code?
    nope also just a blank screen
    Free tips & tricks for you PC www.justrehhoff.org
    Tips for both linux and windows !
    Missing a guide for ubuntu ? don't hestitate we have that to !

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •