After completing an installation using http://localhost/mydrupalsite you are unable to see the site. Instead, you are presented with a dialog box. If you are using Firefox, the box is called "Opening" which reads "You have chosen to open [blank space] which is a: PHTML file from http://localhost. What should Firefox do with this file?" etc.
The problem is caused by a misconfiguration of apache's php file handling. In your apache configuration file you should have something like:
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
or (the following is the /etc/apache2/php5.conf from a custom Ubuntu LAMP set up):
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
# <IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_value engine Off
If you are indeed on an UBUNTU system and the problem appears only if you try to access http://localhost/~userdir/ then most likely in the above file the part:
php_admin_value engine Off
has not been commented out! Commenting this part out and restarting apache (sudo /etc/init.d/apache2 restart) should solve the problem.
Sometimes you may have fixed the problem but you still need to clear your browser cache (or use another browser) before the site displays properly.