[英]How to secure database passwords configure file in PHP?
如何保护PHP中包含数据库密码的配置文件? 再加上我需要详细的方法。
将配置文件(包括的.php
模块)放置在Web服务器无法读取的目录中。 例如:
config.php:
<?php
$db_host = "localhost";
$db_user = "username";
$db_password = "the literal password";
$db_database = "default_db";
?>
这取决于您要确保谁安全? 1)来自某些黑客? 2)从您的客户那里谁可以访问您的源代码? 还是3)您的员工?
在所有情况下,您都可以使用代码混淆来加密代码。 ( http://en.wikipedia.org/wiki/Obfuscation_%28software%29 )
其中一些可以使用的工具是:ioncube(商业)zend guard(商业) http://www.intricks.com/projects/PhpCodeBuster/ (免费),如果需要,您可以在Google上搜索更多内容。
有用的文章: 是否有PHP的代码混淆器?
我正在使用ioncube,并且在所有平台上都可以正常使用(windoes + linux)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.