Comment faire ?

How to fix Warning: require or Fatal error: require

Warning: require(/.../wp-includes/...) [function.require]: failed to open stream: No such file or directory a problem indicating a missing file within WordPress. This can cause various malfunctions depending on the missing file or the number of missing files.

Two examples:

Warning: require(/.../wp-includes/class-wp-meta-query.php) [function.require]: failed to open stream: No such file or directory in /.../wp-settings.php on line 101

Fatal error: require() [function.require]: Failed opening required ‘/.../wp-includes/class-wp-meta-query.php’ (include_path=’.:/.../php’) in /.../wp-settings.php on line 101

Depending on the criticality of the missing file, a simple Warning may be displayed or a Fatal error may occur. It is important to consider these warnings, try to find the cause(s) and deal with them.

Where does this error come from?

Different actions can lead to this type of error. It is best to try to pinpoint the cause in order to solve it and to see that it does not happen again.

  • The foWordPress installation failed
  • WordPress update failed
  • Malicious plugin
  • Clumsy handling of files or folders (moving, deleting …)
  • Malicious act
  • Unsecured site offering access to site files and folders

You can see that there are multiple causes, whose risks and consequences can be varied: a failed installation of WordPress has fewer consequences (just identify the blockage or try again) than a deliberate and malicious act to harm the site (this may involve the destruction of the site or in the worst case access to confidential data in the base). It is up to you to identify the cause of the problem or to call in an expert to do so.

What can be done to solve this problem?

Depending on the origin of the error, there are several possible solutions:

  • If it is the installation of WordPress that is causing the problem: simply try again.
  • If the problem persists, check the rights on the folders, contact your host or try to find out more details about the error to submit it to an expert. You can also, via (S)FTP, try to put the right files in the right places. Be careful in this case, make sure that there are no more errors and that the site is working normally.
  • If it is an update failure: the instructions are the same as for the installation. Please note, however, that you must respect the versions of the files. If you decide to add these files, be sure that your entire WordPress installation is homogeneous, with the files in their correct version.
    If it is a malicious plugin: clean your site, remove all traces of the plugin and analyze the damage caused. The best thing to do is to have a backup of these files and its base and restore them.
  • Manipulating files or folders: simply put the right files back in the right places in the right version.
  • Malicious act: reintroduce the good files but find the origin of this act (a person having access to your site?, rights problem?).
  • Unsecured site offering access to the site’s files and folders: identify the breach in your site to plug it. A site that lacks security is a danger for you and your visitors. Make the right settings, put if necessary recognized security plugins and do not hesitate to ask an expert for an audit of your site and solutions to avoid as much as possible that such problems recur.

Of course, other solutions are possible, especially depending on the identified cause. If you have any doubts, especially in the case of unauthorized access to your site, talk to someone who is familiar with WordPress and server security.

Leave a Comment

Your email address will not be published.

You may also like