Put a test.html file in the Moodle code directory, where the config.php is, and visit http://localhost/test.html.
It that doesn't render the test.html, then your web server is not set up properly. Study its log files. If the test.html shows, then create a phpinfo.php file with content
<?php phpinfo(); ?>
and see whether you see your computer's PHP environment displayed.