All of these problems are created by the developers.
I have created many on-the-fly mini-PHP frameworks to use within existing legacy code bases to avoid all of this.
Easiest way to avoid manually requiring files is to use classes with the auto loader. Done.
The second easiest solution is to have different constants that has the full path to a directory and then just you use the correct constant when doing a require. No relative paths required.
You can even have one require constant per file if that is your game.
Raw sql is fine, just don’t scatter it in every file, instead put sql in specific repositories, e.g ArticleRepository, and do all article queries in there. Now it is easy.
An ORM actually creates more problems when refactoring because entities are spread out everywhere.
If you use something like Phpstorm IDE it can help refactor raw sql too.
Problem is that many developers doesn’t think this thru and even worse they accept the situation and don’t do anything about even if they can. Instead they go to forums and complain. I’m sorry but I have zero tolerance for that.