admin 发表于 2023-3-2 19:25:51

WordPress报错Warning: scandir() has been disabled for security reasons in解决方 ...

<p><ahref="http://www.wangchao.info/wp-content/uploads/2014/12/WordPress.jpg"></a></p>
<p>服务器系统更换为CentOS后,重新安装了一个wordpress程序,在后台什么都没干,发现页面中报出Warning: scandir() has been disabled for security reasons in …. 各种错误警告!</p>
<p>这是什么情况?赶快到网上搜了一下。</p>
<p>原来是scandir被禁用了。通过PHP探针也可以看到。</p>
<p><ahref="http://www.wangchao.info/wp-content/uploads/2015/03/090001176632767.png"></a></p>
<p>很简单,编辑php.ini文件</p>
<p>disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen<br>
去掉scandir保存并重起php-fpm即可。</p>
<p>&nbsp;</p>
<p>php.ini 的位置:/usr/local/php/etc/php.ini</p>
<p>最后执行/etc/init.d/php-fpm restart重启下</p>
<p>&nbsp;</p>
<p>等重启完后,再刷新页面,就会发现以前报的警告没有了。</p>
                                        <p class="post-copyright">未经允许不得转载:<ahref="https://www.wangchao.info/">王超博客</a> &raquo; <ahref="https://www.wangchao.info/279.html">WordPress报错Warning: scandir() has been disabled for security reasons in解决方案</a></p>
页: [1]
查看完整版本: WordPress报错Warning: scandir() has been disabled for security reasons in解决方 ...