php-scandir()报错

 

l       linux下 vim /usr/local/php/etc/php.in

l       直接斜杠找 /disable_functions   回车 

l       按i键

l       去掉scandir

l       按Esc,输入wq!  保存回车       q!是不保存退出    lnmp reestart  重启

==========================

安装thinkphp时报scandir() has been disabled for security reasons

因为PHP里面的scandir函数被禁用了

解决办法:

打开php.ini(路径:/usr/local/php/etc/php.ini),找到这行:

disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,

proc_get_statu,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,

readlink,symlink,popepassthru,stream_socket_server,fsocket,fsockopen

去掉scandir保存并重起php-fpm即可。

很多函数问题,都有可能是php禁用了,大家需要的时候去掉就可以了,为了安全尽量少开启!