Home  >  Article  >  php教程  >  PHP提示Warning:phpinfo() has been disabled函数禁用的解决方法

PHP提示Warning:phpinfo() has been disabled函数禁用的解决方法

WBOY
WBOYOriginal
2016-06-06 20:15:461492browse

这篇文章主要介绍了PHP提示Warning:phpinfo() has been disabled函数禁用的解决方法,涉及针对配置文件中禁用函数的修改技巧,非常具有实用价值,需要的朋友可以参

本文实例讲述了bs/php/2014040278544.html">PHPbs/javascript/2013110861152.html">提示Warning:phpinfo() has been disabled函数禁用的解决方法。分享给大家供大家参考。具体分析如下:

今天在一朋友服务器测试一个网站时发现我在测试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

希望本文所述对大家的php程序设计有所帮助。

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