Jump to content

Warning: readdir(): supplied argument is not a valid Directory resource


markt3404

Recommended Posts

My new host (Siteground) cloned and moved my html/php site (built by the previous owner) from Heart Internet server.

All of the site works except for the sidebar, I get these 2 errors. Anyone shed any light on these at all?

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/customer/www/dunster.org.uk/public_html/include/toolbox.php on line 97

 

Warning: opendir(/home/sites/dunster.org.uk/public_html//local_information) [function.opendir]: failed to open dir: No such file or directory in /home/customer/www/dunster.org.uk/public_html/include/toolbox.php on line 86

Link to comment
Share on other sites

Quote

Warning: opendir(/home/sites/dunster.org.uk/public_html//local_information ) [function.opendir]: failed to open dir: No such file or directory  in /home/customer/www/ dunster.org.uk/public_html/include/toolbox.php on line 86

the path being used in the opendir() statement either has a hard-coded '/home/sites/' in it or is using a variable that has that incorrect value in it.

based on the path where the code is actually at, that part of the path should be - /home/customer/www/

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

To add to what Mac said, usually there are some configuration files involved.  We have no way of saying for sure without code to look at, but a typical strategy would be to set up a variable or constant that contains the site root.    Mac helpfully highlighted the differences for you.  You should do a search through the source files for '/home/sites' and make sure that is replaced with '/home/customer/www'.

Sometimes these configurations are stored in database tables, so that might be the problem if it's not hardcoded.  There is no way for us to know for sure again without looking at some of the sourcecode for the site.

  • Thanks 1
Link to comment
Share on other sites

Thanks guys. The guy who ran the site has retired and I'm taking it over to my hosting but this error appears on my hosting only, Siteground say it's not their issue just old or broken coding. 

.I am still getting to grips with PHP, I can read it but not fully understand it all, HTML and CSS I work with daily but this website will be a hobby of mine until I just rebuild it in WordPress later this year.

Have screenshot the code1111111111111.thumb.jpg.4d93571e9ff62a18aafe268644a65f85.jpg

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.