Can't find Localhost files

26,074

Solution 1

Check out error log (tail /var/log/apache2/error.log) in order to find out exact path that Apache tries to find.

Solution 2

I had the same problem and using the apache logs I've found that the solution is to place your php code inside /html folder so -

sudo mv /var/www/FILENAME.php /var/www/html
Share:
26,074

Related videos on Youtube

GMF
Author by

GMF

Updated on September 18, 2022

Comments

  • GMF
    GMF over 1 year

    Hope you can help. This is my first time trying Ubuntu/Linux.

    I am logged in as root I have downloaded and installed LAMP and PHPMYADMIN. I get the test page under localhost say that It works and is installed Correctly. I have also put my files in the /var/www. they are PHP files When I put the address localhost/(page name.php) I get an error saying

     Not Found
    
     The requested URL /index.php was not found on this server.
     Apache/2.2.22 (Ubuntu) Server at localhost Port 80
    

    I Have put the files in the wrong folder?? If I look in the "/etc/ap[ache2/sites-available/default", It tells my my DocumentRoot is /var/www

    Would love somehelp on this please

    Many thanks GF

    • Gokhan Sari
      Gokhan Sari over 11 years
      How did you install LAMP and phpmyadmin?
    • SirCharlo
      SirCharlo over 11 years
      Please edit your question to add the output of ll -L /var/www
    • blade19899
      blade19899 over 11 years
      did you name you page name.php index.php cause as the error says can't find index.php