如何屏蔽php中的phpinfo()函数

来源:互联网 发布:linux修改文件权限777 编辑:程序博客网 时间:2024/06/10 16:24

  我们配置php环境的时候往往都会写phpinfo();这个函数来测试php环境是否安装成功,但往往这个函数也会给系统带来安全隐患,那么如何让关掉这个函数呢?下面介绍一种方法:

  修改php.ini文件,在里面找到如下行,

  disable_functions = ; This directive allows you to disable certain

  ; functions for security reasons. It receives

  ; a comma separated list of function names.

  ; This directive is *NOT* affected by whether

  ; Safe Mode is turned on or off.

  将其写成

  disble_functions = phpinfo

  重启apache就能实现屏蔽phpinfo();函数了。