The message looks like this: Warning: require_once(...): Failed to open stream: No such file or directory, followed by Fatal error: Failed opening required. The site then shows a blank page or the message “There has been a critical error on this website”. Unlike many WordPress errors, this one is very talkative: it gives the exact path of the missing file. That is the starting point of the whole diagnosis.
Reading the message correctly
The message contains two paths: the file PHP could not find, and the file that tried to load it, with the line number. The first tells you what is missing, the second tells you who is asking for it. If the requesting file sits in wp-content/plugins/some-plugin, the problem comes from that plugin. If it sits in wp-includes or wp-admin, the WordPress core files are incomplete.
The most common causes
- An interrupted update: the plugin or WordPress was only partly copied and files are missing.
- A cache plugin deleted by hand: advanced-cache.php or object-cache.php remain in wp-content and call a plugin that no longer exists.
- A server migration: a hard-coded absolute path still points to the old server, or the case of a file name differs, since Linux treats File.php and file.php as different files.
- An undeployed vendor folder: a theme or plugin installed from Git without running composer install cannot find its autoloader.
- A server restriction: open_basedir or overly strict file permissions prevent PHP from reading a file that does exist.
Step 1: check whether the file really exists
Copy the path from the message and check it over SFTP or SSH. Three cases come up: the file does not exist, it exists with different capitalisation, or it exists but PHP is not allowed to read it.
ls -la /path/given/in/the/message.php
Step 2: repair according to the cause
A plugin file is missing
Reinstall the plugin as it was. With WP-CLI, one command is enough and your settings, stored in the database, are kept:
wp plugin install plugin-name --force
Without access to the dashboard, rename the plugin folder over SFTP, for example by adding -off to its name: WordPress deactivates it and the site comes back. You can then reinstall it cleanly.
Core files are incomplete
Compare your files with the originals, then download the core again without touching the wp-content folder:
wp core verify-checksums
wp core download --force --skip-content
An old cache file is orphaned
If the requesting file is wp-content/advanced-cache.php or object-cache.php, delete it and remove the define( 'WP_CACHE', true ) line from wp-config.php if no cache plugin is installed any more.
The path is hard-coded
In your own code, never build a path from the current directory or an absolute path. Start from the file itself, which works on every server:
require_once __DIR__ . '/inc/helpers.php';
require_once get_template_directory() . '/inc/helpers.php';
The file exists but cannot be read
Apply the standard permissions, 644 for files and 755 for folders, with the right owner. If the message mentions open_basedir, the restriction is set in the host's PHP configuration: ask your host to add the folder concerned.
Keeping the error from coming back
Most of these errors come from an update run straight in production or a migration done by hand. Updating on a staging copy first, deploying from Git with a written procedure and monitoring PHP errors prevent nearly every case. That is exactly what our WordPress maintenance service covers.
Frequently asked questions
What is the difference between require_once and include?
include only produces a warning if the file is missing and the script carries on. require and require_once stop everything, hence the blank page. The _once suffix only prevents loading the same file twice.
The error appeared right after a migration, what should I check first?
Absolute paths in wp-config.php and in cache files, then file name capitalisation if the old server ran on Windows or macOS.
Author
Walid SadfiWalid Sadfi is the founder of Evolurise, a team of engineers deployed on site with its clients: custom development (WordPress, Drupal, React, Laravel), AI agents, DevOps and team training. With 8 years of experience, he supports SMEs and large companies, from understanding the problem to deploying the solution. On this blog he shares practical, field-tested insights.