Invalid argument supplied for foreach() [Resolved]

Nextcloud version 11
Operating system and version Ubuntu 16.04
Apache or nginx version nginx-1.10.3
PHP version 7.1.2
I have the latest next cloud, and I constantly get this error
Error PHP scandir() has been disabled for security reasons at /home/wwwroot/drive/lib/private/L10N/Factory.php#192 2017-03-25T14:24:29-0400
Error PHP Invalid argument supplied for foreach() at /home/wwwroot/drive/lib/private/L10N/Factory.php#194 2017-03-25T14:23:59-0400

If you disable this function you should not wonder that a follow up command is missing an argument. Are there good reasons to disable this function scandir()?

Thanks. I just figured out that the install script I used accidentally disabled scandir()