Wordpress Website Showing Error


#1

Hi My Website is showing error.when we refresh it then its work properly.
Any Idea?

Displaying 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

Please find attached screenshot.

Thanks


#2

Hi vivekwebdev20, welcome to the forums!

The error message shows that you have a problem in your (or your site host’s) server setup, it has nothing to do with the website itself.


#3

Hi,

We already connected to hosting provider but they are not able to resolve this issue.they saying its a developing issue


#4

It looks to me as though one of your plug-ins (or the WP install itself) has not been properly installed. What do you mean by “refresh”? Refresh what?

Slightly off-topic, you should not be displaying error messages and warnings on a live site as they are a security risk.


#5

Thanks …We will not in future.

Actually when we first time open in browser its display above mentioned error then if we refresh same urls then website working properly…not any error came out


#6

Are you developing the live website or a different dev site at the same host?

Do you configure the server your self or is it the hosting provider that does?


#7

My first guess was that it was likely due to a change with the allow_url_fopen setting. The error message being “no such” doesn’t suggest that as the cause (though the “failed to open” could) and it wouldn’t be the first time I’ve seen an error message that was somewhat misleading.

Looking closer, I see “cache”. Considering that the error is only on initial load and not present with a refresh, I’m wondering if “cache” is a temporary folder that is created per session. It would be intuitive to think of a cache folder as being more or less long-lived (persists across sessions) and one would think if it was temporary there would be a name somewhere to indicate that, but it wouldn’t be the first time I saw something with a less than ideal descriptive name.

In any case, I think if there is a chance the opendir might fail it would be a good idea to wrap that bit in a conditional to deal with what happens when there is a fail.


#8

Sir any idea how can we resolve it.


#9

Hi Sir,

We are not developed this website, just maintained.No another website at this host.We are not configure the server.


#10

I’d need to see, if not more, at least the beginning 30 or so lines of the api_model.php file. Is the file open source and available somewhere?


#11

Sir below mentioned file and folder strucuture is not present in my server. I don’t know where is came from
var/www/html/cms/application/models/api_model.php on line 14
/var/www/html/cms/application/models/api_model.php on line 15
/var/www/html/cms/application/models/api_model.php on line 22
/var/www/html/cms/application/models/api_model.php on line 22


#12

I’m not seeing errors. You found and fixed the problem?