php框架中避免sql注入的方法:
1.在php.ini配置文件中打开php的安全模式,例如:
safe_mode = on
2.当safe_mode打开时,将safe_mode_gid关闭,例如:
safe_mode_gid = off
3.在安全模式下指定要履行程序的主目录,例如:
safe_mode_exec_dir = D:/usr/bin
4.控制php脚本只能访问指定的目录,例如:
open_basedir = D:/usr/www
5.关闭危险函数,例如:
disable_functions = system,passthru,exec,shell_exec,popen,phpinfo
6.关闭php版本信息在http头中的泄漏,例如:
expose_php = Off
7.关闭注册全局变量,例如:
register_globals = Off
8.打开magic_quotes_gpc来避免SQL注入,例如:
magic_quotes_gpc = On
本文来源:https://www.yuntue.com/post/62069.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏