Jump to content


Photo

opendir, readdir, closedir warnings?


  • Please log in to reply
6 replies to this topic

#1 hey_im_chris

hey_im_chris
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 July 2006 - 10:22 PM

Hi, I've come up with a good plan to work around my last includes problem, and it's flawless... with everything but the page I want to call. The page I'm trying to include is a php script for an image gallery I pulled off the net about a year ago. If anyone can help and they'd like to take a look at it, you're very welcome. Anyway...

When I call that particular page, I get 3 warning errors:

Warning: opendir(imgs/thumbs): failed to open dir: No such file or directory in /home/.../album.php on line 14

Warning: readdir(): supplied argument is not a valid Directory resource in /home/.../album.php on line 16

Warning: closedir(): supplied argument is not a valid Directory resource in /home/.../album.php on line 49


Any ideas what this means and how to resolve this?

#2 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 10:24 PM

Well basically it can't find /home/imgs/thumbs

Make sure that your referencing it right, and if there should be a leading/ending slash.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#3 hey_im_chris

hey_im_chris
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 July 2006 - 11:02 PM

Well I thought that it might have been a problem with the directory, but it isn't because the page, album.php works fine if I view it directly, but it doesn't work if I call for it in the include.

The include basically says $set .= "/album.php"; with the link set as index.php?set=directory ,so it calls ./directory/album.php, which should work. I'm just confused as to why it doesn't.

#4 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 11:05 PM

I think it's calling the script fine, the problem is INSIDE album.php, it is having trouble opening the imgs/thumbs folder.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#5 hey_im_chris

hey_im_chris
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 July 2006 - 11:14 PM

Lines 14, 16 and 49 all refer to '$myDirectory' and use it in $myDirectory = opendir("imgs/thumbs");, while ($file = readdir($myDirectory)) and closedir($myDirectory); respectively. If you'd like to take a look, I'll attach album.php in a moment! :)

[attachment deleted by admin]

#6 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 09 July 2006 - 12:22 PM

Well, if the imgs folder or the imgs/thumbs/ folder do not exist then there's the problem.

<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#7 hey_im_chris

hey_im_chris
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 09 July 2006 - 04:46 PM

That's just an insult to my intelligence! ;) My directories are set up perfectly fine, otherwise they wouldn't work when I view the page directly. Do you think there's a chance that it's looking for the filepath ./album.php/imgs/thumbs? It's a bit daft, but I'm running out of ideas! ::)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users