InfoPhilic WordPress How to Fix Failed to Open Stream Error in WordPress

How to Fix Failed to Open Stream Error in WordPress

When WordPress.Org releases a new update to it’s WordPress standalone CMS (Content Management System) for that you may have set your website to get your installation updated automatically or you may like to do it your self at your preferred time.

But because of server load on part of your web host, you may get an error ‘failed to open the stream’ on the screen.

This error usually points out the location of the scripts where the error has occurred. In this guide, I will show you how to easily fix the WordPress failed to open stream error.

But before digging deep, let me clear the basic knowledge about this error.

This error occurs when WordPress is unable to load the file mentioned in website code. When this error occurs, sometimes WordPress will continue loading the site and only show a warning message, while other times WordPress will show a fatal error and will not load anything else.

The message phrasing will be different depending on where the error occurs in the code and the reason for failure. It will also give you clues about what needs to be fixed.

Usually, the message will look like this:

Warning: require(/nfs/domains/ [function.require]: failed to open stream: No such file or directory in /nfs/domains/ on line 122

Fatal error: require() [function.require]: Failed opening required '/nfs/domains/' (include_path='.:/usr/local/php-5.3.27/share/pear') in /nfs/domains/ on line 122

There are different reasons that cause this error. In each instance, failed to open stream phrase would be followed by a reason. For example, permission denied, no such file or directory, the operation failed, and more.

But when your error message contains ‘no such file or directory’, then,

  • Look in the code to figure out which file is mentioned at that particular line.
  • If it is a plugin or theme file, then this means that the plugin or theme files were either deleted or not installed correctly.
  • Simply deactivate and reinstall the theme/plugin to fix the error.

Another cause includes that the WordPress is not able to locate the files because of a missing .htaccess file in your root folder.

Permalinks settings in WordPress
Permalinks settings in WordPress

  • Go to Settings » Permalinks page in your WordPress admin.
  • Click on the ‘Save changes’ button to regenerate the .htaccess file.

In case, the error message shows Permission denied, it suggests WordPress does not have the right permission to access the file or directory referenced in the code.

Check WordPress files and directory permissions and correct them if needed.

Download fresh WordPress file from the official site. Delete existing core files from your server directory except for the wp-config.php file and /wp-content/ directory. and upload freshly downloaded files to the server. This will replace all the core files without affecting your site settings and customization.


Following the above steps, your website will start to function as normal as before. What else you tried, let me know in the comment section below.

Amit Malewar
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.



Please enter your comment!
Please enter your name here

Join InfoPhilic Community!

Let's build a community (Facebook Group) to help & encourage each other to grow!


Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple...

How to Remove jQuery Migrate in WordPress?

Learn how to remove jQuery Migrate from your WordPress site.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

How to Root Sony Xperia C (C2305)

Sony Xperia C is a one of the best smartphone available on the market. It comes with Cortex-A7 1.2 GHz quad-core processor along with...


Start your blog or website with Dreamhost

Learn how to start your WordPress blog with Dreamhost hosting. Discover the steps it takes to create a blog in 2020.

Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...



TRY SEMrush for Free!