I set up Apache web server.
When I open
http://localhost in Google Chrome, it asks me to download a file. It works correctly with Firefox.
How can I resolve this issue?
Sounds like your server is sending a Content-Type header that Chrome thinks it should download, rather than display.
You can check for this with:
which should display the headers that the server is sending.
You are probably needing to install php or it is not running at the time that you wish to open a PHP file.
If this is the case, first make sure everything is OK in your PHP config by running the next in a php file which you can name
The result should be like this:
If you are receiving issues in your php config you first try to fix it, and if you receive an info.php file download then you should first install php support in your system, which can easily be achieved via synaptic.