作者:xzh | 来源:互联网 | 2023-02-05 11:43
PossibleDuplicate:Puttingcoreclassesabovethewebroot-goodorbadidea?可能重复:将核心类放在Web根
Possible Duplicate:
Putting core classes above the web root - good or bad idea?
可能重复:将核心类放在Web根目录之上 - 好主意还是坏主意?
I keep reading that it's a best practice to put MySQL connection credentials (whether it's a class, defines, etc..) outside of the web root (above the www folder).
我一直在阅读,最好的做法是在Web根目录之外(在www文件夹之上)放置MySQL连接凭证(无论是类,定义等等)。
Why is this? If the credentials are in a .php file then it doesn't matter if the file is accessible through the browser, right?
为什么是这样?如果凭据在.php文件中,那么通过浏览器访问该文件无关紧要,对吧?
3 个解决方案