I also do research on this topic. File resolution is one strategy, but there are so many vectors.
But let's say in one scenario you have FTP or SSH access to the server, and someone compromises the FTP input. This login is the same as the public_html user folder. This person could view and read these files. To a large extent, this is a bad thing. However, you can have a configuration on the system where you put the user in jail only in your home directory.
Perhaps then you could create a .private folder one level outside of this user's home directory. Then, in php files for this user, who has his own scripts in public_html, there is a connection file that exists in the .private folder (../../. Private / connect.php, for example).
I do not know if this will work if the user is imprisoned, but this view seems safe through an obscure thing.
Soulblighter
source share