RecursiveIteratorIterator does not work - php5-fpm

April 27, 2015 2.7k views
PHP Frameworks PHP Control Panels Ubuntu


I am trying to use RecursiveIteratorIterator with RecursiveDirectoryIterator to return an array of recursive files and folders.

This used to work on a Apache2 + php5 setup but I recently moved over to nginx and php5-fpm.

Everything on my site works perfectly except this particular function.

I do a var_dump on the variable those 2 functions are set on and it returns:

object(RecursiveIteratorIterator)#218 (0) { }

I dunno what’s wrong or if I’m missing a particular php5 package that’s suppose to be installed.

Anyone have any ideas?

1 Answer

Hi! RecursiveIteratorIterator is part of the base php5 package so it should be there by default. Are you getting any errors? Check nginx’s error log:

sudo tail /var/log/nginx/error.log
  • Firstly, thanks for the response. I appreciate it.

    Secondly, I forgot that Laravel had a FileSystem API, so just calling Files::allFiles() was far easier.

    I’ll be taking a look at nginx’s error logs to see where I went wrong.

    Thank you.

Have another answer? Share your knowledge.