Home >php教程 >php手册 >PHP Warning:phpinfo() has been disabled函数禁用

PHP Warning:phpinfo() has been disabled函数禁用

WBOY
WBOYOriginal
2016-05-27 08:47:442372browse

今天在一朋友服务器测试一个网站时发现我在测试phpinfo时碰到PHP Warning:phpinfo() has been disabled for security reasons 提示了,按话的意思我总结了解决办法,下面我们一起来看看吧.

在运行phpinfo时碰到提示如下:PHP Warning: phpinfo() has been disabled for security reasons in XX.php on line XX

这段话的意思是告诉我们由于安全考虑 phpinfo() 函数被禁用,如果你有服务器管理权限请修改 php.ini 配置文件参数并重启apache 重新启用.

打开php安装路径打开php.ini文件,具体实例:在php.ini中存在 disable_functions配置,默认配置中,cli执行函数都是被 禁止的,如果需要的话,需要在php.ini中将 disable_functions = phpinfo,exec , popen, system ….,将你需要执行的函数从列表中删掉在重启apache即可.

完全是配置的问题,linux中解决办法,编辑PHP配置文件:

vi /usr/local/php/etc/php.ini

寻找disable_functions字符串,将后面的scandir删除,提示:vi下可输入/,进入搜索模式,轻松找到disable_functions.

重启PHP生效:

/etc/init.d/php-fpm restart


永久链接:

转载随意!带上文章地址吧。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn