• PHP Help
  • Warning: opendir(cache/domains/): failed to open dir:

Hi Everyone,
My Website is aaron-helmet.com. When we trying to open my website.I am getting error.
Warning: opendir(cache/domains/): failed to open dir: No such file or directory in /var/www/html/cms/application/models/api_model.php on line 14

Warning: readdir() expects parameter 1 to be resource, boolean given in /var/www/html/cms/application/models/api_model.php on line 15

Notice: Undefined variable: domains in /var/www/html/cms/application/models/api_model.php on line 22

Warning: in_array() expects parameter 2 to be array, null given in /var/www/html/cms/application/models/api_model.php on line 22
bad

Any Suggestion?

    Does the cache/domains/ directory exist? I don't know where the directory name is coming from, or where it should be or what it's for. If you think it does exist and you can find it, there may be something about your setup that means the program is not operating in the directory it expects to be.
    Something to try: in line 14 of api_model.php try replacing opendir(whatever) with opendir(realpath(whatever)). It won't fix the problem, but you'll get the full name of the "missing" directory. You can use that as a hint about where things are or should be.

      It should also be noted that 'cache/domains/' is a relative file path -- meaning that this path could resolve to different locations, depending on which file is referring to it. As weedpacket points out, you can use realpath to resolve a relative path into an absolute path.

        Write a Reply...