How to secure database passwords in PHP?

后端 未结 16 1517
闹比i
闹比i 2020-11-21 22:41

When a PHP application makes a database connection it of course generally needs to pass a login and password. If I\'m using a single, minimum-permission login for my applica

16条回答
  •  春和景丽
    2020-11-21 23:23

    Just putting it into a config file somewhere is the way it's usually done. Just make sure you:

    1. disallow database access from any servers outside your network,
    2. take care not to accidentally show the password to users (in an error message, or through PHP files accidentally being served as HTML, etcetera.)

提交回复
热议问题