Developing on localhost remove “index.php”

What you have locally is called PATHINFO permalinks. It is quite rare configuration since permalinks are either “pretty” (what you have live) or “ugly” (no rewrite at all, GET requests).

It is hard to guess why you ended up with PATHINFO configuration if you haven’t deliberately configured it. Might you have used some tool to install WP for you?

You should check your permalink settings and go through relevant documentation. Overall this depends on your existing configuration, your webeserver, and modules it has available. No universal solution.