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?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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:
wget --server-response -O /dev/null http://localhost/
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
info.php and calling it like
localhost/info.php when placed in your localhost root folder, usually
<html> <head> <title> PHP Test Script </title> </head> <body> <?php phpinfo( ); ?> </body> </html>
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.