Best Practices for creating a PHP INI/CONFIG file and keep it secure

后端 未结 3 1303
情书的邮戳
情书的邮戳 2021-02-10 10:45

I always used a normal PHP file and just defined the variables in that file, but is this considered best practice?

Example:



        
3条回答
  •  天涯浪人
    2021-02-10 11:04

    Naming your PHP file something that begins with .ht (for instance .htconfig.inc.php) also helps, since Apache usually has a rule never to serve any files that are named .ht*. But placing your file outside of the document root is even better.

提交回复
热议问题