Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 /public_html 之外有一个必需的配置文件,所以我像这样检索它:
define('FILE_PATH', dirname( __FILE__ ) . '/' ); require(FILE_PATH . '../private/config.php');
我正在使用 PHP 5.4 这样做有什么安全问题吗?谢谢。
不,只要您不将路径的某些部分基于未经验证的用户输入,这很好。