Hi everyone!

I'm trying to move a wordpress page that I have tinkered with on my localhost to my home server and it is causing me some problems of course. On the index page I want to load images from folders via this php code:

$uploads = wp_upload_dir();

if ($dir = opendir($uploads['basedir'].'/gallery/menu/')) {
$images = array();
while (false !== ($file = readdir($dir))) {
if ($file != "." && $file != "..") {
$images[] = $file;
}
}
closedir($dir);
}

As I mentioned, it works on my localhost but not on the server. I get no error messages, it simply won't go through the if statement. Any suggestions would be much appreciated.

Thank you.

Fred

    Although no errors appears on screen surely there is some sort of error message in the error logs ? Its a little hard to diagnose the issue without it.

      Apologies my friend, not being lazy just did not know where to start looking. In the error log it says that the result is too large so I guess I have to change the limits in the php.ini file. Correct? Thank you again.

      Fred

        Or change permission on the folder maybe?

          first do the ini change and then if that doesn't work change the dir permissions

            fredodman;10977684 wrote:

            Apologies my friend, not being lazy just did not know where to start looking. In the error log it says that the result is too large so I guess I have to change the limits in the php.ini file. Correct? Thank you again.

            Fred

            Result is too large ? Sounds to me that the directory has a lot of files in it. Can you paste the error message from the logs ? Don't think any update in the php.ini file is going to fix the issue properly.

              Write a Reply...