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

后端 未结 3 1297
情书的邮戳
情书的邮戳 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 10:54

    unless someone has access to your PHP source code that is secure.

    however I would make sure the file is outside of the document root to prevent problems IF for some reason php gets turned off on the website and all of a sudden people can see the source of your files :).

提交回复
热议问题