Secure storage of database credentials

后端 未结 3 363
闹比i
闹比i 2021-01-03 07:53

Had a major problem recently where my web hosting company messed up and all my php files were displayed in plain text. This was a major issue for me for obvious reasons. Mai

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 08:42

    If for some reason xbonez's answer doesn't work (lets say one doesn't have access to a non document_root folder).. You can achieve the same thing by using .htaccess

    
     order allow,deny
     deny from all
    
    

    This, should in theory (non tested) protect the file from being used in the browser but not block php from including said file.

提交回复
热议问题