How do I remove the index.php from all URLS in Craft 2 CMS?
It sounds like you haven't set up your .htaccess file or have failed to rename it. The file in the default set up doesn't have the . at the start.

Read https://docs.craftcms.com/v2/installing.html carefully. The bit concerning htaccess is just before step 2.

Also ensure you're files are in the right place.