Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3432940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:30:44+00:00 2026-05-18T07:30:44+00:00

I want to start learning PHP, so I installed Apache2, MySQL and PHP5 on

  • 0

I want to start learning PHP, so I installed Apache2, MySQL and PHP5 on my Ubuntu 10.10 today. For some reason, when I try to open a file other than index.html from the default directory /var/www/, I either get a 404 error or I get a prompt to download the php file. I googl’d all over and I can’t find a solution.

When I do http://localhost/index.html, it works, and displays whatever I write in index.html. When I change /index.html to /test.php, I get an error saying “The requested URL /test.php was not found on this server”.

When I try /var/www/index.html or file:///var/www/index.html, again, index.html appears although it appears differently. When opened with http://localhost/index.html I only get “It works!”, but with /var/www/index.html I get “It works!
This is the default web page for this server.

The web server software is running but no content has been added, yet.”

And then when I change /var/www/index.html to /test.php, I get a prompt to download test.php.

In my .conf files, the default directory is set to /var/www/, so this is very weird.

Edit:

Did some checking, and it seems that when I run http://localhost it’s set to a directory in the httpd directory. I tried putting my test.php file there, and still I’m getting 404. But when I write the full path, again, I get a download prompt.

This problem is really confusing… thanks to all helpers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:30:44+00:00Added an answer on May 18, 2026 at 7:30 am

    Ok.. seems that I found the solution myself. For some weird reason, I have like 4 different localhost default folders. I had to search manually through each folder containing index.html and move test.php there. Eventually, I found an obscure folder somewhere in the /usr/ folder, moved test.php to there, and it worked. Apparently I have like 4 different versions for each .conf file, and each one states a different thing. Only one of them works.

    Phew. What a relief.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning how to do things, and want to start using some sort
I have PHP background and want to start learning C++. How should I proceed?
I want to start learning HTML and AJAX using a Linux distribution. Can anyone
I've been using Winforms since .NET 1.1 and I want to start learning WPF.
I want to start with an audio file of a modest filesize, and finish
I have a PHP page and I want to share some data between pages
I want to start learning jQuery, but there's so much you can do with
I want to start learning Ajax, but I don't know how to start to
I want to start using Python for small projects but the fact that a
I want to start working with TDD but I don't know really where to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.